I need to create a vector of dates, weekdays only for a function I am
working on. Thanks to the chron library, I have managed to accomplish
this, but is there is a better / easier way. This is what I have thus
far.

        range.dates <- seq.dates('02/02/2009', '03/13/2009', by =
        'days')
        range.days <- weekdays(range.dates)
        weekends <- which(range.days == "Sat" OR range.days == "Sun")
        range.dates[weekends] <- NA
        range.dates <- sort(range.dates)

I am trying to get better with R and I appreciate any feedback or
suggestions you may have.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to