On Tue, Aug 31, 2010 at 7:04 PM, Alistair Gray <agg...@paradise.net.nz> wrote:
> Dear List,
> I'm getting weird and unexpected behaviour using time and %%, or %/%. It's
> likely I'm not appreciating the nuances of floating point arithmetic. Or it
> could be a bug.
>

Here are two workarounds to get the year

   time(junk) - (cycle(junk) - 1) / frequency(junk)

   library(chron)
   month.day.year(junk)$year

and this will get the month as a number between 1 and 12:

   cycle(junk)


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