Here's the code I'm running
library(quantmod)
library(tseries)
Stocks={}
companies=c("IOC.BO","BPCL.BO","ONGC.BO","HINDPETRO.BO","GAIL.BO")
for(i in companies){
Stocks[i]=getSymbols(i)
}
I'm trying to get a list of dataframes that are obtained from getSymbols
to get stored in Stocks
.
The problem is that getSymbols
directly saves the dataframes to the global environment Stocks
only saves the characters in companies
in the list.
How do I save the dataframes in the Global Environment to a list?
Any help is appreciated.. Thanks in advance!