title: How to forecast time series for many products, including a seasonality factor in R
body: <p>Following my <a href="https://stackoverflow.com/questions/51608121/how-to-forecast-time-series-including-a-seasonality-factor-in-r">previous question</a> with one product to forecast, lets say I have 5 products to forecast as in the following data:</p>
  
  <pre><code> units_vector &lt;- c(89496264,81820040,80960072,109164545,96226255,96270421,95694992,117509717,105134778,0)
  library(data.table)
  dt &lt;- data.table('time' = rep(c(1:10),3),
                   'units'= c(units_vector,units_vector+runif(n = 10, max = 1000000),units_vector+runif(n = 10, max = 1000000)),
                   'product' = c(rep("A", 10),rep("B", 10),rep("C", 10))
  )
  </code></pre>
  
  <p>I would like to forecast the <code>units</code> for <code>time = 10</code> for all <code>product</code>s.</p>
  
  <p>I can see that at <code>time = 4*k</code>, where <code>k = 1,2,...</code> there is a big increase of units, and I would like to include that as a seasonality factor.</p>
  
  <p>How could I do that in <code>R</code> ? Maybe with <code>prophet</code> ? Any other <code>library</code> or way will also do.</p>