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