title: Time series forecasting in R - mention the range of prediction dates
body: <p>I have used arima+stl model for time series forecast in R for predicting exchange rates.</p>
  
  <pre><code>ui.R
  shinyUI(
  sidebarLayout(   
  headerPanel("Time Series forecasting with arima+stl"),
  sidebarPanel(
  
    dateRangeInput('dateRange',
                   label = paste('Date range selection'),
                   start = textOutput("text1"),
                   end = textOutput("text2"), 
                   separator = " - ", 
                   weekstart = 1
    )
  ),
  mainPanel(
    textOutput("text1"),
    textOutput("text2"),
    textOutput('forecast')   
  ) 
  )
  )
  </code></pre>
  
  <p>server.R</p>
  
  <pre><code>library(forecast)
  parameters &lt;- read.csv("~/RWD/stl+arima/data/parameters.csv")
  shinyServer(
  function(input, output, session){
  
        predictVariable &lt;- ts(parameters[,2],start=c(2000,1),end=c(2009,12),frequency=12)
        fit.stl &lt;- stl(predictVariable, s.window = "periodic")
        factors &lt;- ts(as.data.frame(parameters[,3:8]),start=c(2000,1),end=c(2009,12),frequency=12)
        outfactors &lt;- ts(parameters[,3:8],start=c(2010,1),end=c(2012,12),frequency = 12)
        output$forecast &lt;- renderPrint({ forecast(fit.stl,h=10,
            forecastfunction=function(x,h,level=95){
                fit &lt;- Arima(x,xreg=factors)
                return(forecast(fit,xreg=outfactors))})
     })
  })
  </code></pre>
  
  <p>The above code is working fine. The data from 2000-2009 is used to forecast the exchange rates of next 3 years.My data is parameters.But I want to create a user interface where the user can mention the start and end dates for which he/she requires exchange rates forecast. In server.R, in the forecast function how do I use the dates taken as input in ui.R to mention the start and end dates for which I need the forecast.</p>