On Aug 17, 2011, at 4:52 PM, Folkes, Michael wrote:
Hello all,
I'm hoping to convert a decimal value for week of the year back to a
date object.
Eg:
strptime(paste(2010,1:52,sep=" "),format="%Y %W")
Yeah, agree that seems as though it should have been successful. I
cannot get any of my invocations using %W to work.
> strptime(Sys.Date(), "%Y-%m-%d-%W")
[1] NA
> strptime(Sys.Date(), "%Y-%m-%d")
[1] "2011-08-17"
> strptime(Sys.Date(), "%Y-%m-%d %W")
[1] NA
Oh well.
seq.POSIXt(as.POSIXlt("2010-01-01"), by="week", length=52)
I expected (hoped?) this would give me the date for Monday of each
week. Instead, it's giving me 52 values of today's date.
Where am I erring?
Thanks
Michael
David Winsemius, MD
West Hartford, CT
______________________________________________
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.