Hi Michael

I am not sure of your decimal format of the week but if you can convert it to a calendar day of the year by multiplying by 7
then you could you could use eg if 321 was the calendar day

 strptime(paste(2010, 321,sep=" "),format="%Y %j")
[1] "2010-11-17"

Regards

Duncan


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
ARMIDALE NSW 2351
Email: home [email protected]



At 06:52 18/08/2011, you 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")

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

_______________________________________________________
Michael Folkes
Salmon Stock Assessment
Canadian Dept. of Fisheries & Oceans
Pacific Biological Station
3190 Hammond Bay Rd.
Nanaimo, B.C., Canada
V9T-6N7
Ph (250) 756-7264 Fax (250) 756-7053  [email protected]


        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

______________________________________________
[email protected] 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