Similar to the problem in Convert UNIX epoch to Date object in R, mine deals with one column of a large data table (about 250k rows). The column is a vector of many epoch times, e.g., dt$time=
c(1388839764L, 1388846894L, 1388998785L, 1389496318L, 1389525690L,
1389545726L, 1389608509L, 1389672286L, 1389696208L, 1389747353L)
How to convert such a long vector to date object? as.POSIXct(dt$time, origin='1970-01-01')
has poor efficiency for such vector. While fastPOSIXct
from fasttime
doesn't have the origin
as an argument.