I am using the quantmod R package. Is there a way to have getSymbols return a generic xts object instead of the symbol I am getting. For instance, if I have execute:
getSymbols("COKE", src='yahoo', index.class=c("POSIXt","POSIXct"), from='1990-01-01')
It creates the xts object in the name of symbol COKE. As said, is there a way to return a xts data object to a generic variable like x. I.e.
x <- getSymbol(...)
I am have looked high and low for a solution but no answers.
Thanks
It's in ?getSymbols
(emphasis added):
Value:
A call to getSymbols will load into the specified environment one object for each ‘Symbol’ specified, with class defined by ‘return.class’. Presently this may be ‘ts’, ‘its’, ‘zoo’, ‘xts’, or ‘timeSeries’.
If ‘auto.assign’ is set to FALSE an object of type ‘return.class’ will be returned.
For example:
x <- getSymbols("COKE", auto.assign=FALSE)
Before looking high and low, it's a good idea to read and understand the documentation. ;-)