Re: [R] number of Mondays

2009-01-15 Thread Carlos Hernandez
Indeed, i overlooked weekdays. Thank you all for your replies! On Jan 15, 2009, at 21:23 , Prof Brian Ripley wrote: Or for those not allergic to reading help, see ?weekdays . Just how hard do you have to work to miss that? E.g. ??day works. On Thu, 15 Jan 2009, Peter Dalgaard wrote: Carl

Re: [R] number of Mondays

2009-01-15 Thread Prof Brian Ripley
Or for those not allergic to reading help, see ?weekdays . Just how hard do you have to work to miss that? E.g. ??day works. On Thu, 15 Jan 2009, Peter Dalgaard wrote: Carlos Hernandez wrote: dear All, i'm trying to calculate the number of Mondays, Tuesdays, etc that each month within a date

Re: [R] number of Mondays

2009-01-15 Thread Peter Dalgaard
Carlos Hernandez wrote: > dear All, > i'm trying to calculate the number of Mondays, Tuesdays, etc that each > month within a date range has. I have time series data that spans 60 > months and i want to calculate the number of Mondays, Tuesdays, Wed, etc > of each month. (I want to control for week

Re: [R] number of Mondays

2009-01-15 Thread Gabor Grothendieck
Try this: > library(zoo) # as.yearmon > dd <- seq(as.Date("2000-01-01"), as.Date("2004-12-31"), "day") > dow <- as.numeric(format(dd, "%w")) > ym <- as.yearmon(dd) > tab <- do.call(rbind, tapply(dow, ym, table)) > rownames(tab) <- format(as.yearmon(as.numeric(rownames(tab > head(tab)

Re: [R] number of Mondays

2009-01-15 Thread David Winsemius
On Jan 15, 2009, at 2:28 PM, Carlos Hernandez wrote: dear All, i'm trying to calculate the number of Mondays, Tuesdays, etc that each month within a date range has. I have time series data that spans 60 months and i want to calculate the number of Mondays, Tuesdays, Wed, etc of each month

Re: [R] number of Mondays

2009-01-15 Thread Roy Mendelssohn
?chron() in particular day.of.week -Roy On Jan 15, 2009, at 11:28 AM, Carlos Hernandez wrote: dear All, i'm trying to calculate the number of Mondays, Tuesdays, etc that each month within a date range has. I have time series data that spans 60 months and i want to calculate the number of M

[R] number of Mondays

2009-01-15 Thread Carlos Hernandez
dear All, i'm trying to calculate the number of Mondays, Tuesdays, etc that each month within a date range has. I have time series data that spans 60 months and i want to calculate the number of Mondays, Tuesdays, Wed, etc of each month. (I want to control for weekly seasonality but my dat