[R] function approx interpolation of time series data sets

e-letter inpost at gmail.com
Wed Jan 16 09:52:00 CET 2013


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. Tried the following command
but received the error shown:

data3<-approx(data1,xout=data2)
Error in approx(data1, xout = data2) :
  (list) object cannot be coerced to type 'double'

What is my mistake please?

--
r2151



More information about the R-help mailing list