title: Expand an list in an R dataframe into additional rows of the dataframe?
body: <p>In a <a href="https://stackoverflow.com/questions/34206003/how-to-flatten-r-data-frame-that-contains-lists">separate question earlier today</a> I asked how to flatten nested lists into a row in a dataframe. I wish to further understand how to manipulate my lists within a dataframe, this time by expanding the list vertically within the dataframe, adding new rows to accommodate the the data. </p>
  
  <p>In this case I wish to go from this structure:</p>
  
  <pre><code>CAT    COUNT            TREAT
  A      1,2,3            Treat-a, Treat-b
  B      4,5              Treat-c,Treat-d,Treat-e
  </code></pre>
  
  <p>To this structure:</p>
  
  <pre><code>CAT   COUNT  TREAT
  A     1      Treat-a   
  A     2      Treat-b
  A     3      NA 
  B     4      Treat-c 
  B     5      Treat-d
  B     NA     Treat-e
  </code></pre>
  
  <p>Code to generate the test (source) data:</p>
  
  <pre><code>df&lt;-data.frame(CAT=c("A","B"))
  df$COUNT &lt;-list(1:3,4:5) # as numbers
  df$TREAT &lt;-list(paste("Treat-", letters[1:2],sep=""),paste("Treat-", letters[3:5],sep=""))
  </code></pre>
  
  <p>I tried using CBIND in an approach similar to the answer supplied to my earlier question but it failed due to the different number of values between the multiple lists. Thank you for your patience as I attempt to grasp these basic manipulation tasks.</p>