José José - 1 year ago 82
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?

Answer Source

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download