Convert numeric to date
You were setting wrong order of month and date values (in your code was Year, Date, Month, should be Year, Month, Date).
as.Date("20100727", "%Y%m%d")
[1] "2010-07-27"
You were setting wrong order of month and date values (in your code was Year, Date, Month, should be Year, Month, Date).
as.Date("20100727", "%Y%m%d")
[1] "2010-07-27"