title: could not convert index to appropriate type while attempting to plot weekly ts object in dygraphs
body: <p>I'm trying to create a Holt-Winters forecast from a weekly time series, then plot the original series and forecast using dygraphs.  I have 144 weeks of friday week-ending data.  For my purpose, I'm ignoring that some years have 53 weeks.  The structure of the data can be simulated by:</p>
  
  <pre><code>## create data similar to what I have
  
  week_date &lt;- seq.Date(from = as.Date("2012/05/11"),
                        by = "week",
                        length.out = 144)
  set.seed(1)
  var1 &lt;- diffinv(rnorm(143))
  df &lt;- data.frame(cbind(week_date, var1))
  
  ## convert to ts object then
  ## create Holt Winters forecast
  
  dfts &lt;- ts(df[,2],freq=52, start=c(2012,19))
  
  hw &lt;- HoltWinters(dfts)
  p &lt;- predict(hw, 4)
  all &lt;- cbind(dfts, p)
  
  ## create plots
  
  dygraph(all, "time series dygraph") %&gt;%
        dySeries("var1", label = "Actual") %&gt;%
        dySeries(c("p.lwr", "p.fit", "p.upr"), label = "Predicted")
  </code></pre>
  
  <p>This produces the following error:</p>
  
  <pre><code>Error in as.xts.ts(data) : could not convert index to appropriate type
  </code></pre>
  
  <p>I tried the solution proposed <a href="https://stackoverflow.com/questions/28305610/use-dygraph-for-r-to-plot-xts-time-series-by-year-only">here</a>, but am getting the same error:</p>
  
  <pre><code>&gt; all &lt;- cbind(dfts = as.xts(dfts), p = as.xts(p))
  Error in as.xts.ts(dfts) : could not convert index to appropriate type
  </code></pre>