Re: [R] function approx interpolation of time series data sets

2013-01-18 Thread Rui Barradas
Hello, Both Gabor's and my way work and produce the same results: #-- Gabor library(zoo) library(chron) data1 <- " 01:23:40 5 01:23:45 10 01:23:50 12 01:23:55 7" data2 <- " 01:23:42 01:23:47 01:23:51 01:23:54 01:23:58 01:23:59" data1zoo <- read.zoo(text=data1, FUN=times) data2zoo <- read.z

Re: [R] function approx interpolation of time series data sets

2013-01-18 Thread e-letter
On 18/01/2013, Gabor Grothendieck wrote: > On Fri, Jan 18, 2013 at 7:31 AM, e-letter wrote: >> On 16/01/2013, Rui Barradas wrote: >>> Hello, >>> >>> Like this? >>> >>> >>> data1 <- read.table(text = " >>> 01:23:40 5 >>> 01:23:45 10 >>> 01:23:50 12 >>> 01:23:55 7 >>> ") >>> >>> data2 <- read.tabl

Re: [R] function approx interpolation of time series data sets

2013-01-18 Thread e-letter
On 18/01/2013, Gabor Grothendieck wrote: > On Fri, Jan 18, 2013 at 7:31 AM, e-letter wrote: >> On 16/01/2013, Rui Barradas wrote: >>> Hello, >>> >>> Like this? >>> >>> >>> data1 <- read.table(text = " >>> 01:23:40 5 >>> 01:23:45 10 >>> 01:23:50 12 >>> 01:23:55 7 >>> ") >>> >>> data2 <- read.tabl

Re: [R] function approx interpolation of time series data sets

2013-01-18 Thread Gabor Grothendieck
On Fri, Jan 18, 2013 at 7:31 AM, e-letter wrote: > On 16/01/2013, Rui Barradas wrote: >> Hello, >> >> Like this? >> >> >> data1 <- read.table(text = " >> 01:23:40 5 >> 01:23:45 10 >> 01:23:50 12 >> 01:23:55 7 >> ") >> >> data2 <- read.table(text = " >> 01:23:42 >> 01:23:47 >> 01:23:51 >> 01:23:54

Re: [R] function approx interpolation of time series data sets

2013-01-18 Thread e-letter
On 16/01/2013, Rui Barradas wrote: > Hello, > > Like this? > > > data1 <- read.table(text = " > 01:23:40 5 > 01:23:45 10 > 01:23:50 12 > 01:23:55 7 > ") > > data2 <- read.table(text = " > 01:23:42 > 01:23:47 > 01:23:51 > 01:23:54 > ") > > approx(as.POSIXct(data1$V1, format = "%H:%M:%S"), y = data1

Re: [R] function approx interpolation of time series data sets

2013-01-16 Thread Rui Barradas
Hello, Like this? data1 <- read.table(text = " 01:23:40 5 01:23:45 10 01:23:50 12 01:23:55 7 ") data2 <- read.table(text = " 01:23:42 01:23:47 01:23:51 01:23:54 ") approx(as.POSIXct(data1$V1, format = "%H:%M:%S"), y = data1$V2, xout = as.POSIXct(data2$V1, format = "%H:%M:%S")) Hope this h

[R] function approx interpolation of time series data sets

2013-01-16 Thread e-letter
Readers, Am trying to use the function 'approx' to interpolate time series data sets: data1: 01:23:40 5 01:23:45 10 01:23:50 12 01:23:55 7 data2: 01:23:42 01:23:47 01:23:51 01:23:54 The objective is to obtain interpolated values of 'data1' column 2 (5, 10, 12, 7) for the times shown in data2. T