[R] use zoo package with multiple column data sets

e-letter inpost at gmail.com
Fri Jan 29 14:34:55 CET 2010


Assuming my documentation is correct, my version shows faq 1 to refer
to duplicate times but if file2 is:

01:01:01        11      55
01:01:04        22      66
01:01:07        33      77
01:01:10        44      88

I cannot see what is duplicate? If I create two new files:

file3:
01:01:01        11
01:01:04        22
01:01:07        33
01:01:10        44

file4:
01:01:01        55
01:01:04        66
01:01:07        77
01:01:10        88

The previous commands work:

z1<-read.zoo("path/to/file1.csv",header=TRUE,sep=",",FUN=times)
z2<-read.zoo("path/to/file3.csv",header=TRUE,sep=",",FUN=times)
z3<-(na.approx(merge(z1,z2),time(z1)))
plot(z3$z1,z3$z2)

and:

z1<-read.zoo("path/to/file1.csv",header=TRUE,sep=",",FUN=times)
z2<-read.zoo("path/to/file4.csv",header=TRUE,sep=",",FUN=times)
z3<-(na.approx(merge(z1,z2),time(z1)))
plot(z3$z1,z3$z2)

Shouldn't I be able to have one file containing all the columns I want
to make graphs, instead of having to create numerous files of only two
columns of data?



More information about the R-help mailing list