i am trying show Mar '21 as first and then go chronologically down from there
emp.data <- data.frame(
emp_id = c (1:12),
emp_name = c("Rick","Dan","Michelle","Ryan","Gary","aa","bb","cc","dd","ee","qq","ww"),
m_year =c("Dec-2020", "Nov-2020", "Oct-2020", "Sep-2020", "Aug-2020",
"Jul-2020", "Jun-2020", "May-2020", "Apr-2020", "Mar-2021", "Feb-2021",
"Jan-2021")
)
i tried to sort the variable but still i am not getting the expected order
emp.data$m_year = emp.data$m_year[order(as.yearmon(emp.data$m_year, "%b-%Y"), decreasing = TRUE)]