title: Insert new rows of imputed data into data table by group
body: <p>i have a data table and i would like to insert new rows imputing values between two years. This will be done over many ID groups. how do i go about replicating the data into the new rows?</p>
  <pre><code># data table
  dt &lt;- data.table(ID=c(rep(1:3,each=3)), 
  attrib1=rep(c(&quot;sdf&quot;,&quot;gghgf&quot;,&quot;eww&quot;),each=3), 
  attrib2=rep(c(&quot;444&quot;,&quot;222&quot;,&quot;777&quot;),each=3), 
  Year = rep(c(1990, 1995, 1996), 3), 
  value = c(12,6,7,6,3,1,9,17,18))
  </code></pre>
  <p>so for all groups (ID), Year would go from 1990 to 1996 and the 2 values for 1990 &amp; 1995 would be imputed linearly. All other attributes would remain the same and be copied into the new rows.</p>
  <p>i've done this with a hideously long work around and attempted a custom function, but to no avail</p>