title: Add months to IDate column of data.table in R
body: <p>I have been using data.table for practically everything I was using data.frames for, as it is much, much faster on big in-memory data (several million rows). However, I'm not quite sure how to add days or months to an IDate column without using apply (which is very slow).</p>
  
  <p>A minimal example:</p>
  
  <pre><code>dates = c("2003-01-01", "2003-02-01", "2003-03-01", "2003-06-01", "2003-12-01", 
            "2003-04-01", "2003-05-01", "2003-07-01", "2003-09-01", "2003-08-01")
  dt = data.table(idate1=as.IDate(dates))
  </code></pre>
  
  <p>Now, let's say I want to create a column with dates 6 months ahead. Normally, for a single IDate, I would do this:</p>
  
  <pre><code>seq(dt$idate1[1],by="6 months",length=2)[2]
  </code></pre>
  
  <p>But this won't work as from= must be of length 1:</p>
  
  <pre><code>dt[,idate2:=seq(idate1,by="6 months",length=2)[2]]
  </code></pre>
  
  <p>Is there an efficient way of doing it to create column idate2 in dt?</p>
  
  <p>Thanks a lot,
  RR</p>