[R] Delete Dates from a vector.

Gabor Grothendieck ggrothendieck at gmail.com
Sun Jan 25 12:00:09 CET 2009


See:
https://stat.ethz.ch/pipermail/r-help/2008-September/173522.html

On Sat, Jan 24, 2009 at 11:01 PM, pluribus <pluribus at overdetermined.net> wrote:
> 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 at 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.
>




More information about the R-help mailing list