Skip to content
Prev 7261 / 15274 Next

Create a Monday-Friday time series?

On Thu, Jan 6, 2011 at 12:29 PM, <Murali.Menon at avivainvestors.com> wrote:
To add to this try:

library(timeDate) # holidayNYSE
library(chron) # .Holidays / is.holiday / is.weekend

# this will be used by is.holiday
.Holidays <- chron(as.Date(holidayNYSE(year = 2010)))

StartDate <- as.Date("2010-01-01")
EndDate <- as.Date("2010-04-01")

dd <- seq(StartDate, EndDate, by = "day")

dd[!is.weekend(dd) & !is.holiday(dd)]