This works as expected:
> as.Date("07/01/08","%m/%d/%y")
[1] "2008-07-01"
But not this:
> as.Date("07/08","%m/%y")
[1] NA
Bonus question, explain this:
> as.Date("08","%y")
[1] "2008-09-08"
UPDATE
OK, so I guess I can get something reasonable with this?
my.date = "07/08"
as.Date(paste0("01/",my.date),"%m/%d/%y")
Anything simpler? I've got a column of month/years I'd like to convert to Date objects:
my.dates = c("07/08","08/08","09/08","10/08")
as.Date(paste0("01/",my.dates),"%m/%d/%y")