1. require(rCharts)
  2. require(quantmod)
  3. spy <- getSymbols("SPY",auto.assign=FALSE)
  4. colnames(spy) <- c("open","high","low","close","volume","adjusted")
  5. spy.df <- data.frame(index(spy),spy)
  6. colnames(spy.df)[1] <- "date"
  7. nOHLC <- nPlot(
  8. x = "date",
  9. y = "close",
  10. data = spy.df,
  11. type = "ohlcBar"
  12. )
  13. nOHLC$srccode =
  14. "nOHLC$srccode"
  15. nOHLC