How to sort a data frame by date

The Solution to How to sort a data frame by date is


Assuming your data frame is named d,

d[order(as.Date(d$V3, format="%d/%m/%Y")),]

Read my blog post, Sorting a data frame by the contents of a column, if that doesn't make sense.

~ Answered on 2011-06-05 22:04:25


Most Viewed Questions: