Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何对 60 年的 10 月至次年 4 月的日期进行排序?我试过
seq(from=as.Date("1950-10-1"),to=as.Date("2011-12-31"),by="day")
但不知道如何在 5 月到 9 月之间搭车,感谢任何帮助,谢谢
df <- data.frame(date=seq(from=as.Date("1950-10-1"),to=as.Date("2011-12-31"),by="day")) df <- within(df, { month <- as.numeric(format(date, "%m")) }) q <- with(df, df[month<5 | month>9,]) unique(q$month) head(q$date)