I have a data frame with a date column and two columns of observations. I want to create a new data frame where only the observations that are from business days are included.
I tried df=df[which(weekdays.Date(as.Date.dates(df$Date, format = "%Y-%m-%d")) %in% c('Rmetrics/NYSE'))
, ] to only include rows that contain dates that are in the NYSE calendar. This did not work.
You can use
timeDate::holidayNYSE()
to get a holiday calendar for the New York Stock Exchange.