On Tue, Jun 29, 2010 at 6:22 AM, Simon Kiss <sjk...@gmail.com> wrote:
> Dear colleagues, particularly academic ones,
> So I'm creating a Microsoft Word template for myself so that every time I
> teach a new course, I don't have to enter in the dates manually for each
> class session.
> I'd like to use an R script that can generate an irregular series of dates
> starting from one date (semester begin) to another (semester end) using an
> irregular interval in between (Tuesdays and Thursdays, for example).
> I know that a regular series of dates is no problem, but what about an
> irregular series?

Generate all the dates in the range of interest and then pick off the
Tuesdays and Thursdays:

dd <- seq(as.Date("2010-01-01"), as.Date("2010-12-31"), "day")
dd[weekdays(dd) %in% c("Tuesday", "Thursday")]

______________________________________________
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