Re: [R] Delta in time series

2009-06-10 Thread christiaan pauw
Or x=c("2009-03-09 12:00:00","2009-03-09 13:30:00") y=data.frame(x) attach(y) x=as.POSIXlt(x) x[1]-x[2] On Wed, Jun 10, 2009 at 5:04 AM, koj wrote: > > > > > > I have time data in the following format: > > > > 2009-03-09 12:00:00 > > 2009-03-09 13:30:00 > > > > > [[alternative HTML v

Re: [R] Delta in time series

2009-06-10 Thread Gabor Grothendieck
Try this: > library(zoo) > Lines <- "2009-03-09 12:00:00,1 + 2009-03-09 13:30:00,2" > z <- read.zoo(textConnection(Lines), sep = ",", tz = "") > 1/frequency(as.zooreg(z)) [1] 5400 noting that 5400 seconds is 1.5 hours. On Wed, Jun 10, 2009 at 5:04 AM, koj wrote: > > Hi all, > > I have time data

Re: [R] Delta in time series

2009-06-10 Thread koj
koj wrote: > > Hi all, > > I have time data in the following format: > > 2009-03-09 12:00:00 > 2009-03-09 13:30:00 > > Now I want to compute the delta between the two time points, which results > in this example in 1,5 h. I tried this via "ts" and the related functions > but so far without s

[R] Delta in time series

2009-06-10 Thread koj
Hi all, I have time data in the following format: 2009-03-09 12:00:00 2009-03-09 13:30:00 Now I want to compute the delta between the two time points, which results in this example in 1,5 h. I tried this via "ts" and the related functions but so far without sucess. Can anybody help me? Thank y