[R] Dates - week and year not day.

holdnatalie osp627 at bangor.ac.uk
Tue Aug 16 10:01:39 CEST 2011


Hi,

I would be very grateful for some advice. I have read the help pages for
Date, strptime, etc. All examples seem to use some version of day month year
as date format. However I have Weekly composite data so ONLY want to input
the dates as Week.Year (eg 35.2011). strptime seems to show this is possible
using %W for week (UK convention) and %Y for year. My data is in a df called
chlorophyll and has a date column. I tried to use the following (after I
converted to characters using as.character);

chlorophyll$date <- strptime("chlorophyll$date", "%W.%Y")

It recognised the year but replaced the week part with todays date (16TH
August).

Any advice?
Thanks
Natalie

--
View this message in context: http://r.789695.n4.nabble.com/Dates-week-and-year-not-day-tp3746591p3746591.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list