powered by
as.Date.numeric requires origin to be specified. The present function assumes that this origin is January 1, 1970.
as.Date.numeric
origin
as.Date1970(x, ...)
Returns a vector of Dates
a numeric vector of dates in days since the start of 1970.
optional arguments to pass to as.Date.
as.Date
Spencer Graves
as.Date as.POSIXct1970
as.POSIXct1970
days <- c(0, 1, 365) Dates <- as.Date1970(days) stopifnot( all.equal(c('1970-01-01', '1970-01-02', '1971-01-01'), as.character(Dates)) ) stopifnot( all.equal(days, as.numeric(Dates)) )
Run the code above in your browser using DataLab