[R] How to get the day of the year

Henrique Dallazuanna wwwhsd at gmail.com
Wed Oct 1 13:42:23 CEST 2008


In addition to Richard, try this also:

format(strptime(newdatestr, "%a %d/%b/%Y %H:%M:%S"), "%j")

On Wed, Oct 1, 2008 at 5:42 AM, Solene Goy <olsen-olsen at hotmail.fr> wrote:
>
> Hello,
> I am new to R and I would like to get the day of the year from numerous data in the following form:  %a %d/%b/%Y %H:%M:%S (for example from Tu 10/Jul/2007 21:59:13 I would like to get 191)
>
> Whatever I try, I get NAs.
>
> Well... I need your help, please!
> Thanks in advance
> Yours sincerely,
> Solène Goy
> _________________________________________________________________
>
> [[elided Hotmail spam]]
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at 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.
>
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list