[R-SIG-Finance] Time given the week number and year.

Kalisbek K Malikov kkmalikov at suffolk.edu
Tue Oct 11 04:56:27 CEST 2011


You can try this:
as.Date(paste("2011-01","-01", sep=""))
[1] "2011-01-01"
Hope this helps.
Kalis.
-----Original Message-----
From: r-sig-finance-bounces at r-project.org [mailto:r-sig-finance-bounces at r-project.org] On Behalf Of Kevin Burton
Sent: Monday, October 10, 2011 10:29 PM
To: r-sig-finance at stat.math.ethz.ch
Subject: [R-SIG-Finance] Time given the week number and year.

I am trying to convert from a week number and year to a date. The first thing I try

strptime("2011-01", "%Y-%W")

gives me:

[1] "2011-10-10"

This is wrong as the first week of the year is not in October. Any suggestions on how I can do this conversion?

Thank you.

Kevin

_______________________________________________
R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list