Search code examples
rquantmodfinancial

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?


Solution

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

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