Create a Vector of All Days Between Two Dates
问题 Is there an easy way in R for me to itemize all valid days that occurred between two specified dates? For instance, I'd like the following inputs: itemizeDates(startDate="12-30-11", endDate="1-4-12") To produce the following dates: "12-30-11" "12-31-11", "1-1-12", "1-2-12", "1-3-12", "1-4-12" I'm flexible on classes and formatting of the dates, I just need an implementation of the concept. 回答1: You're looking for seq > seq(as.Date("2011-12-30"), as.Date("2012-01-04"), by="days") [1] "2011-12