[datatable-help] "Error in Ops.POSIXt" using 1.9.x

dnlbrky danielrlabar at gmail.com
Mon Mar 24 06:35:55 CET 2014


Running the following using data.table version 1.8.10 or 1.8.11 (Windows 7)
works as expected:

n <- 12
dt <- data.table(id=rep(letters[1:(n/3)], each=3),
                 d=seq(as.POSIXct("2013-01-01"), by="month", length.out=n))
dt[, list(d2=seq(d, dt[, max(d)], by="month")), by=list(id, d)][1:15]

>     id          d         d2
>  1:  a 2013-01-01 2013-01-01
>  2:  a 2013-01-01 2013-02-01
>  3:  a 2013-01-01 2013-03-01
>  4:  a 2013-01-01 2013-04-01
>  5:  a 2013-01-01 2013-05-01
>  6:  a 2013-01-01 2013-06-01
>  7:  a 2013-01-01 2013-07-01
>  8:  a 2013-01-01 2013-08-01
>  9:  a 2013-01-01 2013-09-01
> 10:  a 2013-01-01 2013-10-01
> 11:  a 2013-01-01 2013-11-01
> 12:  a 2013-01-01 2013-12-01
> 13:  a 2013-02-01 2013-02-01
> 14:  a 2013-02-01 2013-03-01
> 15:  a 2013-02-01 2013-04-01

After upgrading to 1.9.x (latest version at writing was 1.9.3) however, I
get the following:

>Error in Ops.POSIXt(del, by) : '/' not defined for "POSIXt" objects

If I replace `seq` with `seq.Date` then I get:

>Error in seq.Date(d, dt[, max(d)], by = "month") : 
  'from' must be a "Date" object

Am I doing something wrong?  Is this a bug?  Is there a workaround?



--
View this message in context: http://r.789695.n4.nabble.com/Error-in-Ops-POSIXt-using-1-9-x-tp4687400.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list