On Fri, Aug 20, 2010 at 3:09 PM, Gabor Grothendieck
wrote:
> On Fri, Aug 20, 2010 at 10:56 AM, Sasha Hafner wrote:
>> Hi,
>>
>> I am having trouble using the ave function with a POSIXct object. For
>> example:
>>
>> x<-Sys.time()+0:9*3600
>> dat<-data.frame(id=rep(c('a','
>> b','c'),each=10),dt=r
On Fri, Aug 20, 2010 at 10:56 AM, Sasha Hafner wrote:
> Hi,
>
> I am having trouble using the ave function with a POSIXct object. For
> example:
>
> x<-Sys.time()+0:9*3600
> dat<-data.frame(id=rep(c('a','
> b','c'),each=10),dt=rep(x,3),i=rep(1:10,3))
> dat
>
> # This is what I want to do:
> dat$ti
On Aug 20, 2010, at 10:56 AM, Sasha Hafner wrote:
Hi,
I am having trouble using the ave function with a POSIXct object. For
example:
x<-Sys.time()+0:9*3600
dat<-data.frame(id=rep(c('a','
b','c'),each=10),dt=rep(x,3),i=rep(1:10,3))
dat
# This is what I want to do:
dat$time.elapsed<-unsplit(la
Hi,
I am having trouble using the ave function with a POSIXct object. For
example:
x<-Sys.time()+0:9*3600
dat<-data.frame(id=rep(c('a','
b','c'),each=10),dt=rep(x,3),i=rep(1:10,3))
dat
# This is what I want to do:
dat$time.elapsed<-unsplit(lapply(split(dat$dt,dat$id),function(x)
x-x[1]),f=dat$id
4 matches
Mail list logo