I am trying to calculate business days between two days. Successfully, I calculated the days without Saturday and Sunday from this question(Calculate the number of weekdays between 2 dates in R), and now I am trying to implement national holidays into this code. How can I add national holidays into here?

Thanks! I tried to reflect the caluculation to all the rows, and got "Error in seq.Date(a, b, "days") : 'from' must be of length 1" Do you know any idea of this error? StartDate <- as.Date(df$StartDate) EndDate <- as.Date(df$EndDate) df$Business_Days<- Nweekdays(StartDate, EndDate, holidays, weekend)
– MarieAug 7 '17 at 22:41

The function above does what you ask for in original question. Hard to help you more when I don't know the shape of your data.frame.
– sindri_baldurAug 7 '17 at 22:45