This works:
library(quantmod)
tickers <- "AAPL"
tickers.out <- getSymbols(tickers)
L <- mget(tickers.out)
but this next one does not because the object it creates is called "IXIC" and not "^IXIC". The output of getSymbols should correspond to the object names that are created, not to the input symbols. Alternately make the output objects the same as the input object names.
library(quantmod)
tickers <- "^IXIC"
tickers.out <- getSymbols(tickers)
L <- mget(tickers.out)
## Error: value for ‘^IXIC’ not found
This works:
but this next one does not because the object it creates is called "IXIC" and not "^IXIC". The output of getSymbols should correspond to the object names that are created, not to the input symbols. Alternately make the output objects the same as the input object names.