On Tue, Aug 30, 2011 at 1:36 PM, Christopher W Ryan
<cr...@binghamton.edu> wrote:
> Running R 2.13.1 on Windows XP.
> I would like to get week of the year (1-52) for each date.
>
> library(chron)
> dts <- dates(c("02/27/92", "02/27/92", "01/14/92","02/28/92", "02/01/92"))

Try this:

as.numeric(cut(dts, "weeks"))


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
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.

Reply via email to