I'm trying to convert some dates that are currently set as numeric to a date class. e.g. 19870101
for example:
> as.Date.numeric(19870101, origin = "1970-01-01")
[1] "56417-06-28"
Why does this not return the correct date which should be "1987-01-01"
. Does anyone know what I am doing wrong here, is the origin argument wrong?
Any ideas? Thanks!