【发布时间】:2023-03-10 21:06:01
【问题描述】:
我想将我的 df time 列重新排序为从 04:00 开始,而不是从 00:00 开始。订单将是04:00、05:00、...、00:00、01:00、02:00、03:00 我该怎么做?
<-structure(list(time=c ("00:00", "01:00","02:00","03:00", "04:00", "05:00", "06:00", "07:00",
"08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00",
"19:00", "20:00", "21:00", "22:00", "23:00"),
Season = c(1, 2, 3, 5, 6, 7,8,9,10,12,1,1, 2, 3, 5, 6, 7,8,9,10,12,9,10,12),
Total= c(1, 2, 3, 5, 6, 7,8,9,10,12,1,1, 2, 3, 5, 6, 7,8,9,10,12,9,10,12 )
), row.names = c(NA,24L), class = "data.frame")
【问题讨论】:
-
简单就是最好的。
rbind(df[5:24,],df[1:4,])