[R] use zoo package with multiple column data sets
e-letter
inpost at gmail.com
Sat Jan 30 12:08:58 CET 2010
> library(chron)
> library(zoo)
> z1<-read.zoo("~/path/to/test1.csv",header=TRUE,sep=",",FUN=times)
> z2<-read.zoo("~/path/to/test2.csv",header=TRUE,sep=",",FUN=times)
> z3<-(na.approx(merge(z1,z2),time(z1)))
Error in approx(along[!na], y[!na], along[na], ...) :
need at least two non-NA values to interpolate
> z3<-(na.approx(merge(z1,z2[,2]),time(z1)))
Error in approx(along[!na], y[!na], along[na], ...) :
need at least two non-NA values to interpolate
> z3<-(na.approx(merge(z1,z2[,3]),time(z1)))
Error in `[.zoo`(z2, , 3) : subscript out of bounds
> z4<-read.zoo(textConnection(z2),FUN=times)
Error in textConnection(z2) : invalid 'text' argument
More information about the R-help
mailing list