From ggrothendieck at gmail.com  Tue Mar 18 18:04:18 2008
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Tue, 18 Mar 2008 13:04:18 -0400
Subject: [Rd] cut.Date and cut.POSIXt problem
Message-ID: <971536df0803181004x5ebbe960q6879506089b3e428@mail.gmail.com>

cut.Date and cut.POSIXt indicate that the breaks argument
can be an integer followed by a space followed by "year", etc.
but it seems the integer is ignored.

For example, I assume that breaks = "3 months" is supposed
to cut it into quarters but, in fact, it cuts it into months as if
3 had not been there.

> d <- seq(Sys.Date(), length = 12, by = "month")
> cut(d, "3 months")
 [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
2009-02-01
> cut(as.POSIXct(d), "3 months")
 [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
2009-02-01
> cut(as.POSIXlt(d), "3 months")
 [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
2009-02-01



[Rd] cut.Date and cut.POSIXt problem
Gabor Grothendieck