title: Apply seq.Date using two dataframe columns
body: <p>I tried to use the varies answers from
  <a href="https://stackoverflow.com/questions/11494511/expanding-a-sequence-in-a-data-frame">Expanding a sequence in a data frame</a>
  to my dataframe, but nothing I tried works. </p>
  
  <p>Sample Data</p>
  
  <pre><code>library(dplyr)    
  p1 &lt;- c(1:5)
  p2 &lt;- as.Date(c("2013-01-01","2013-01-22","2014-02-01","2014-05-12","2015-02-22"))
  p3 &lt;- as.Date(c("2013-01-11","2013-01-30","2014-02-20","2014-05-22","2015-02-28"))
  p4 &lt;- c(11,9,20,11,7)
  df2 &lt;- data_frame(p1,p2,p3,p4)
  names(df2) &lt;- c("ID", "StartDate", "EndDate", "NoDays")
  df2
  </code></pre>
  
  <p>Desired Result</p>
  
  <pre><code>ID  datelist    NoDays
  1   2013-01-01   1
  1   2013-01-02   1 
  1   2013-01-03   1
  etc..
  1   2013-01-10   1
  1   2013-01-11   1
  2   2013-01-22   1
  2   2013-01-23   1
  etc.
  2   2013-01-28   1
  2   2013-01-29   1
  2   2013-01-30   1
  </code></pre>
  
  <p>Here are three code trials - all of which I tried in numerous variants (e.g. verious members of the apply family), but all failed (i.e. giving diverse error messages):</p>
  
  <p>code example 1 </p>
  
  <pre><code>datelist &lt;- seq.Date(from = df2$StartDate, to=df2$StartDate, by="days")
  </code></pre>
  
  <p>code example 2</p>
  
  <pre><code>datelist &lt;- seq.Date(from = df2$StartDate, by="days", length.out = df2$NoDays)
  </code></pre>
  
  <p>code example 2</p>
  
  <pre><code>datelist &lt;- apply(df2, 1, seq.Date(from = df2$StartDate, to=df2$StartDate, by="days"))
  </code></pre>