[R] manipulating weeks dates

Gabor Grothendieck ggrothendieck at gmail.com
Wed Mar 15 14:26:15 CET 2006


Try:

as.Date(paste(YEAR, WEEK, 0), "%Y %U %w")

On 3/15/06, Ronaldo Reis-Jr. <chrysopa at gmail.com> wrote:
> Hi,
>
> I have these vectors:
>
> > WEEK <- rep(c(1:52),2)
> > YEAR <- rep(c(2000,1999),c(52,52))
>
> How to make a vector of Date with weeks in years? I try as.date from survival
> package, but it dont work with weeks, just only with days, months etcs.
>
> Thanks
> Ronaldo
> --
> "Realmente minha cidade e muito facultativa"
>
> --Elivelton, ao repórter da Jovem Pan que falava das muitas
>  faculdades que existiam em sua cidade natal.
> --
> |>   // | \\   [***********************************]
> |   ( õ   õ )  [Ronaldo Reis Júnior                ]
> |>      V      [UFV/DBA-Entomologia                ]
> |    /     \   [36570-000 Viçosa - MG              ]
> |>  /(.''`.)\  [Fone: 31-3899-4007                 ]
> |  /(: :'  :)\ [chrysopa at insecta.ufv.br            ]
> |>/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
> |    ( `-  )   [***********************************]
> |>>  _/   \_Powered by GNU/Debian Woody/Sarge
>
> --
> Cerveja? Serve já!
> --
> |>   // | \\   [***********************************]
> |   ( õ   õ )  [Ronaldo Reis Júnior                ]
> |>      V      [UFV/DBA-Entomologia                ]
> |    /     \   [36570-000 Viçosa - MG              ]
> |>  /(.''`.)\  [Fone: 31-3899-4007                 ]
> |  /(: :'  :)\ [chrysopa at insecta.ufv.br            ]
> |>/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
> |    ( `-  )   [***********************************]
> |>>  _/   \_Powered by GNU/Debian Woody/Sarge
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list