dmurdoch@pair.com
2003-Jun-04 02:15 UTC
[Rd] Re: cut.POSIXt problem in R 1.7.1 beta (PR#3181)
On Tue, 3 Jun 2003 06:45:41 -0700 (PDT), you wrote:>The following cut.POSIXt problem is from R 1.7.1 beta which I downloaded from uwo. > >Here x is a sequence of dates and b are those breakpoints that represent the 9th of each month. > > > x <- seq(ISOdate(2003,6,1),by="day",length=100) > > b <- x[format(x,"%d")=="09"] > > cut(x,b) > Error in sort(breaks) : `x' must be atomic > >This problem appears in earlier versions of R too.This one is easy. Here's a patch to fix it: diff -r1.45.2.1 datetime.R 632c632 < breaks <- as.POSIXlt(breaks) ---> breaks <- as.POSIXct(breaks)