I\'m struggling with something very basic: sorting a data frame based on a time format (month-year, or, “%B-%y” in this case). My goal is to calculate various monthly statis
You could reorder factor levels by reorder function.
reorder
tmp09$monthYear <- reorder(tmp09$monthYear, as.numeric(as.Date(tmp09$ExitTime)))
Trick is to use numeric representation of date as number of days since 1970-01-01 (see ?Date) and use mean value of it as reference.
?Date