I have a data table with characters in two columns:
01/01/2014 | 00:30
02/01/2014 | 01:00
03/01/2014 | 01:30 etc
The length of this data set varies, but easily exceeds 300,000 lines when running the script. In the end, I know that this script will have to process a dataset of 30,000,000 plus rows.
I currently have pastethem in the following form:
DT[, DateTime := paste(Date, Time)
That leads to:
01/01/2014 00:30
02/01/2014 01:00
03/01/2014 01:30 etc
Then I use as.POSIXctto convert this value to a POSIX date:
DT[, DateTime:= as.POSIXct(x = DateTime, format = "%d/%m/%Y %H:%M")]
This works fine by correctly converting characters, basically, I suppose, because I gave a format argument so that it matches the structure of the character string that it supplied.
fasttime, , format . , :
DT[, DateTime := fastPOSIXct(x = DateTime)]
fasttime " : , , , , , ". :
2006/07/07 00:30
2007/07/07 01:00
2008/07/07 01:30 etc
, as.POSIXct, โโ .
fasttime? ? , , fasttime, fasttime ?