Search code examples
rchartsquantmod

using reChart in quantmod


I am trying to use the reChart tool in quantmod to zoom into my chart, following the example from here: http://www.quantmod.com/documentation/chartSeries.html

however, when I try to zoom back out to the original chart, it doesn't work. Is there an example that could show how to zoom back out to the original chart


Solution

  • Use subset=""

    Also, see ?zoomChart

    > library(quantmod)
    > getSymbols("SPY", src='yahoo', from='2011-01-01', to='2012-01-01')
    [1] "SPY"
    > chartSeries(SPY)
    > zoomChart("last 1 week") # zoom in
    > reChart(subset="") # zoom out
    
    > zoomChart("last 2 months") # zoom in
    > zoomChart() # zoom out