How to shift data by a factor of two months in R?
问题 I would like to move down my entire data by a factor of two months. For example, if my data starts on Jan 01, i want to move the data in such a way that the data corresponds to March 01. Likewise, November data would become January data for the next year. Here is my sample code DF <- data.frame(seq(as.Date("2001-01-01"), to= as.Date("2003-12-31"), by="day"), A = runif(1095, 0,10), D = runif(1095,5,15)) colnames(DF) <- c("Date", "A", "B") I tried DF$Date <- DF$Date + 61 but this moved the