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.
10月から次の4月までの日付を60年間シーケンスするにはどうすればよいですか?私は試した
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)