jeudi 4 décembre 2014

Combine multiple text files into a single time series using R


Vote count:

0




This should be a simple task in r but I can't seem to get it right. I have multiple text files with single column and no header. I just want to combine them to have a single time series. Order doesn't matter. I tried following:



t1 <- read.table("t1.txt") # 3,5,4,.....
t2 <- read.table("t2.txt") # 5,6,0,.....
so on...
m <- merge(t1 = as.zoo(t1), t2 = as.zoo(t2))


I get:



1 3 5
2 5 6
3 4 0
. . .
. . .


But I need it like following in single column:



3
5
4
.
.


Any suggestions?



asked 1 min ago

Ibe

280






Combine multiple text files into a single time series using R

Aucun commentaire:

Enregistrer un commentaire