title: Generate date series in data.table
body: <p>I have a fairly simple question. See the following data.table (dt):</p>
  
  <pre><code>library(data.table)
  
  dt = data.table(id = c(rep("1",5), rep("2",10)))
  dt$date &lt;- as.Date("2000-01-01")
  dt[, Index := seq_len(.N)-1, by = c("id")]
  
  dt
   id          date Index
   1:  1 2000-01-01     0
   2:  1 2000-01-01     1
   3:  1 2000-01-01     2
   4:  1 2000-01-01     3
   5:  1 2000-01-01     4
   6:  2 2000-01-01     0
   7:  2 2000-01-01     1
   8:  2 2000-01-01     2
   9:  2 2000-01-01     3
  10:  2 2000-01-01     4
  11:  2 2000-01-01     5
  12:  2 2000-01-01     6
  13:  2 2000-01-01     7
  14:  2 2000-01-01     8
  15:  2 2000-01-01     9
  </code></pre>
  
  <p>From this I want to create an additional column (lets call it date2) where each value in <code>Index</code> represents the relevant month in the future. </p>
  
  <p>I.e. when index is 0 (first and sixth row) date2 = date. However, when index = 2 then date2 = (date + 2 months) = 2000-03-01 and so on.</p>
  
  <p>A tried this function:</p>
  
  <pre><code>dt$date2 &lt;- seq(dt$date, by = paste(dt$Index ,"months"), length = 2)[2]
  </code></pre>
  
  <p>Unfortunately, I can only pass one value to <code>from</code> and <code>by</code>. I have a very large dataset and would like to have a fast and simple solution.</p>