Prof Brian Ripley wrote:

That is not a complete date! Which day of the week is it?


example1<-"200301"
strptime(paste(example1, "1", format="%Y%U %d")


will work, and you need to do something like that to resolve the ambiguity.


Doesn't seem to work:


- 6th day of 5th week:

> strptime("2003 05 06", format="%Y %U %d")
[1] "2003-01-06"

Ah ha. Use '%w' for 'day of week':

> strptime("2003 05 06", format="%Y %U %w")
[1] "2003-02-02"

I dont have a calendar to hand to check that 2 Feb is the 6th day of the 5th week....

Barry

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to