title: Pad data frame with missing dates in a series
body: <p>I've aggregated a data frame of rows representing events into another data frame of daily counts using <code>aggregate()</code>. The resultant frame is sorted by date, but it's missing days with zero counts, and I want to fill those days in to get a continuous daily series. The count frame looks something like this:</p>
  
  <pre><code>agg &lt;- data.frame(
      date = as.Date(c("2013-04-02", "2013-04-04", "2013-04-07", "2013-04-08")),
      count = c(4, 2, 6, 1))
  </code></pre>
  
  <p>The way I previously solved this was by iterating through the frame to find non-continuous days, then rbinding subsets of the frame with an empty one. But this is an ugly solution, horrible to debug and painfully inefficient to boot. My thinking is that it would be better to generate a new data frame, populate it with the target date series...</p>
  
  <pre><code>target &lt;- data.frame(
      date = seq(from = as.Date("2013-04-01"), to = as.Date("2013-04-10"), by = "day"),
      count = NA)
  </code></pre>
  
  <p>... and then somehow project counts from <code>agg</code> onto <code>target</code> using the matching dates. Does anyone know how I'd do this -- or have a better solution?</p>