[R] manipulating weeks dates

Gabor Grothendieck ggrothendieck at gmail.com
Wed Mar 15 20:00:28 CET 2006


Given that there are more than 7 * 52 days in a week you may
need to think about what it is that you want.

This will give you Jan 1 for Week 1, Jan 8 for Week 2, etc.

as.Date(paste(YEAR,1,1,sep="-")) + 7 * (WEEK - 1)

That or some variation of that might be suitable.  See the help
desk article in R News 4/1 for more info on dates.


On 3/15/06, Ronaldo Reis-Jr. <chrysopa at gmail.com> wrote:
> Em Quarta 15 Março 2006 10:26, Gabor Grothendieck escreveu:
> > as.Date(paste(YEAR, WEEK, 0), "%Y %U %w")
>
> Hi,
>
> it works, but it use a year with 53 weeks, I need to use with 52 weeks, how to
> change this?
>
> Thanks
> Ronaldo
> --
> Errigal Mountains <--> Tailoring manure
>                -- anagrama
> --
> |>   // | \\   [***********************************]
> |   ( õ   õ )  [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