[R] Problem with all.equal and POSIXt.

2010-09-12 Thread Rolf Turner
I'm getting an error when applying all.equal() to objects of class POSIXt. E.g. x - strptime(rep(2007-02-12,10),format=%Y-%m-%d) all.equal(x,x) Error in target[[i]] : subscript out of bounds The object seems to have to be of double-digit length to trigger the error. E.g.

Re: [R] Problem with all.equal and POSIXt.

2010-09-12 Thread Joshua Wiley
I get the same error. On debugging, after the 10th iteration (~1,375 lines after the all.equal(x, x) call), I get: exiting from: all.equal(target[[i]], current[[i]], check.attributes = check.attributes, ...) debugging in: all.equal(target[[i]], current[[i]], check.attributes =

Re: [R] Problem with all.equal and POSIXt.

2010-09-12 Thread Peter Ehlers
On 2010-09-12 20:32, Joshua Wiley wrote: I get the same error. On debugging, after the 10th iteration (~1,375 lines after the all.equal(x, x) call), I get: exiting from: all.equal(target[[i]], current[[i]], check.attributes = check.attributes, ...) debugging in: all.equal(target[[i]],

Re: [R] Problem with all.equal and POSIXt.

2010-09-12 Thread Rolf Turner
On 13/09/2010, at 3:07 PM, Peter Ehlers wrote: SNIP I'm not sure that I would call this a bug, but it would seem helpful to return an appropriate error message or to coerce to POSIXct. Note that all.equal(as.POSIXct(x), as.POSIXct(x)) yields TRUE, as does using as.Date(x).