[R] day of the year for chron objects

Gabor Grothendieck ggrothendieck at gmail.com
Fri Jun 8 13:28:15 CEST 2012


On Fri, Jun 8, 2012 at 7:16 AM, Jannis <bt_jannis at yahoo.de> wrote:
> The following appears to be pretty "standard" (though not included in chron)
> to me:
>
>  b = ISOdate(2001,12,12)
>  format(b, '%j')
>

Using POSIXct here is error prone because it needlessly introduces
time zones into a problem where they are not relevant.  Subsequent
computations might inadvertently use GMT when local time zone was
desired or visa versa resulting in errors.  See R News 4/1 for info on
choosing date and time classes.

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



More information about the R-help mailing list