I know the start date start
and the last date maturity
. How can I fill in a vector with dates without taking weekends dates into account ?
For ins
This less human than @joran answer:) , but it is no local-time depending
dd <- seq(as.Date('2011-01-01'),as.Date('2011-12-31'),by = 1)
dd[! (as.POSIXlt(dd)$wd %in% c(0,1))]
PS : another option , is to set locals before applying weekdays
tt <- Sys.getlocale('LC_TIME')
Sys.setlocale('LC_TIME','ENGLISH')
dd <- dd[!weekdays(x) %in% c('Saturday','Sunday')]
Sys.setlocale('LC_TIME',tt)