José José - 5 months ago 45
R Question

Retrieve data 'quantmod' package

I am trying to retrieve the SP500 data with:

SP500 <- getSymbolsundefined"^GSPC", from ="2000-01-01", to = "2016-08-31", auto.assign = FALSE)

But I got the following error:

Error: unexpected string constant in "SP500 <- getSymbolsundefined"^GSPC""

Any advice?


Um, you have a trivial syntax error? This obviously works:

SP500 <- getSymbols("^GSPC", from ="2000-01-01", to = "2016-08-31", auto.assign = FALSE)