Re: [R] how to get information of many stocks by using loop cycling in R

2014-06-09 Thread William Dunlap
Make 'S' either an environment or a list. E.g., SymList <- lapply(c("TIBX","X","IBM"), getSymbols, auto.assign=FALSE) # lapply returns a list or SymEnv <- new.env() # or SymList <- list() for(sym in c("TIBX", "X", "IBM")) SymEnv[[sym]] <- getSymbols(sym, auto.assign=FALSE) Use SymList[["T

[R] how to get information of many stocks by using loop cycling in R

2014-06-09 Thread 黄齐
Dear R-core : I am a user of R language from China. I have some problems when I use function ¡°getSymbols¡± which belongs to package ¡°quantmod¡±,and I hope I can get some help from you. I can get some information of one stock just by entering ¡°s1<-getSymbols("600016.ss",from = "2011-05-01",to =