[R] feeding merge.zoo a vector containing the names of zoo objects?

rich.p.martin rich.p.martin at gmail.com
Sat Mar 15 14:37:20 CET 2008


Hi, the snippet of code below works, but I would like to know how to feed the
function merge.zoo the contents of 
CADstocknames rather than having to hard code it into the merge.zoo command. 
I think I must be missing something simple, but I cannot for the life of me
figure it out.  Thanks in advance for any enlightenment offered.   


library(zoo)
CADstocknames <-  c("xbb.to","xsb.to","xiu.to")
for(i in 1:length(CADstocknames)){
assign(CADstocknames[i], get.hist.quote(CADstocknames[i],quote =
"AdjClose"))
}
mergedCAD <- merge.zoo(xbb.to,xsb.to,xiu.to, all = TRUE, retclass
="data.frame")
tail(mergedCAD)



-- 
View this message in context: http://www.nabble.com/feeding-merge.zoo-a-vector-containing-the-names-of-zoo-objects--tp16067806p16067806.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list