[R] RFE: vectorized behavior for as.POSIXct tz argument

2011-12-02 Thread Jack Tanner
x - 1472562988 + 1:10; tz - rep(EST,10) # Case 1: Works as documented ct - as.POSIXct(x, tz=tz[1], origin=1960-01-01) # Case 2: Fails ct - as.POSIXct(x, tz=tz, origin=1960-01-01) If case 2 worked, it'd be a little easier to process paired (time, time zone) vectors from different time zones.

Re: [R] RFE: vectorized behavior for as.POSIXct tz argument

2011-12-02 Thread David Winsemius
On Dec 2, 2011, at 2:28 PM, Jack Tanner wrote: x - 1472562988 + 1:10; tz - rep(EST,10) # Case 1: Works as documented ct - as.POSIXct(x, tz=tz[1], origin=1960-01-01) # Case 2: Fails ct - as.POSIXct(x, tz=tz, origin=1960-01-01) sapply(tz, function(ttt) as.POSIXct(x=x, tz=ttt,

Re: [R] RFE: vectorized behavior for as.POSIXct tz argument

2011-12-02 Thread Jack Tanner
David Winsemius dwinsemius at comcast.net writes: sapply(tz, function(ttt) as.POSIXct(x=x, tz=ttt, origin=1960-01-01),simplify=FALSE) Sure, there's no end of workarounds. It would just be consistent to treat both the x and the tz arguments as vectors.

Re: [R] RFE: vectorized behavior for as.POSIXct tz argument

2011-12-02 Thread David Winsemius
On Dec 2, 2011, at 4:06 PM, Jack Tanner wrote: David Winsemius dwinsemius at comcast.net writes: sapply(tz, function(ttt) as.POSIXct(x=x, tz=ttt, origin=1960-01-01),simplify=FALSE) Sure, there's no end of workarounds. It would just be consistent to treat both the x and the tz arguments