[Rd] Re: cut.POSIXt problem in R 1.7.1 beta (PR#3181)

dmurdoch at pair.com dmurdoch at pair.com
Wed Jun 4 03:15:35 MEST 2003


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)



More information about the R-devel mailing list