How to sort a data frame by date

前端 未结 7 754
孤城傲影
孤城傲影 2020-11-28 21:46

I need to sort a data frame by date in R. The dates are all in the form of \"dd/mm/yyyy\". The dates are in the 3rd column. The column header is V3. I have seen how to s

7条回答
  •  感情败类
    2020-11-28 22:13

    If you have a dataset named daily_data:

    daily_data<-daily_data[order(as.Date(daily_data$date, format="%d/%m/%Y")),] 
    

提交回复
热议问题