Skip to content
Prev 164891 / 398502 Next

Sorting a date vector

You might want to look at your date format more closely. Both the  
separator and the year format specs fail to match your input.

 > as.Date("10-02-2008", format = "%m/%d/%y")
[1] NA
 > as.Date("10-02-2008", format = "%m-%d-%Y")
[1] "2008-10-02"