[R] R Newbie: quantmod and zoo: Warning in rbind.zoo(...) : column names differ
Aval Sarri
aval.sarri at gmail.com
Wed Sep 3 01:46:04 CEST 2008
Hello;
I am trying following but getting a warning message : Warning in
rbind.zoo(...) : column names differ, no matter whatever I do.
Also I do not want to specify column names manually, since I am just
writing a wrapper function around getSymbols to get chunks of data
from various sources - oanda, dividends etc.
I tried giving col.names = T/F, header = T/F and skip = 1 but no help.
I think problem is that getSymbols returns a zoo objects whose
index/first column is null. I write these data in a file and read it
again using read.zoo; when I try to append to these data (using one
more call to getSymbols) it throws this warning message.
<code>
library("quantmod")
options(warn = 1)
part1<-getSymbols(Symbols="USD/EUR", src="oanda", from="2008-01-01",
to="2008-01-10", auto.assign=F, return.class="zoo")
print(dimnames(part1))
write.zoo(part1,"USDEUR", col.names=T) # writes as
part2 <- read.zoo("USDEUR", header=T)
print (dimnames(part2)) # dinames or attributes
part3<-getSymbols(Symbols="USD/EUR", src="oanda", from="2008-01-21",
to="2008-01-31", auto.assign=F, return.class="zoo")
print(dimnames(part3))
allpart <- c(part2, part3)
cat ("-----allparts----\n")
print(dimnames(allpart))
write.zoo (allpart, "USDEUR.all", col.names=T)
</code>
I am not sure how to handle this, please kindly provide some pointer.
Thanks and Regards
-Aval.
More information about the R-help
mailing list