title: How can I merge dataframes of unequal length but known chunk length?
body: <p>I have a model where individuals can die and reproduce. I record information from the model at set intervals. I know the identity of the individuals and the iteration number I sampled from:</p>
  
  <pre><code>df1&lt;-data.frame(
  who= c(1,2,3,4,1,2,3,3,5),
  iteration = c(1,1,1,1,2,2,2,3,3)
  )
  df1
  </code></pre>
  
  <p>But each of the individuals has a list of numbers associated with it that I want to track. Because each individual has more than one number associated with it, I get two data frames of unequal sample size. </p>
  
  <pre><code>df2 &lt;- data.frame(values=c(1,1, # id = 1
                             1,2, # id = 2
                             2,1, # id = 3
                             0,0, # id = 4
                             1,1, # id = 1
                             1,2, # id = 2
                             2,1, # id = 3
                             2,1, # id = 3
                             0,0)) # id = 5
  df2
  </code></pre>
  
  <p>I want to bind them so the 'who' variable is matched up with its value. I did the following to split the values up into the right sized chunks but now I'm stuck. </p>
  
  <pre><code>df3 &lt;- split(df2$values, ceiling(seq_along(df2$values)/2))
  </code></pre>
  
  <p>I should get something out that looks like this:</p>
  
  <pre><code>who iteration value1 value2
  1      1      1       1
  2      1      1       2
  3      1      2       1
  4      1      0       0
  1      2      1       1
  2      2      1       2
  3      2      2       1
  3      3      2       1  
  5      3      0       0
  </code></pre>