I am trying to add a business day to some dates but cannot seem to get it right. What I have currently is:
d$plusOneBusinessDay <- AllDays + 1
or
d$plusOneBusinessDay <- AllDays + days(1) # adds one day but also adds weekend and holidays
d$plusOneBusinessDay <- AllDays + wday(1) # addes one week
I am only interested in business days, so if something occurs on a Friday I want to roll it over to the monday. I have been looking at lubridate
and timedate
also RQuantLib
but cannot get it working.
Any help would be great!
Data:
d <- data.frame(AllDays=seq(as.Date("2012-01-01"),
as.Date("2015-08-18"),"day"))