title: Unlist all list elements in a dataframe
body: <p>I have a data frame with the following classes of variables for each column:</p>
  
  <pre><code>"date" "numeric" "numeric" "list" "list" "numeric"
  </code></pre>
  
  <p>The data in each row looks like this:</p>
  
  <pre><code>    1978-01-01, 12.5, 6.3, c(0,0,0.25,0.45,0.3), c(0,0,0,0.1,0.9), 72
  </code></pre>
  
  <p>I would like to transform it into a matrix or a data frame with one value per column, so the result should look like this:</p>
  
  <pre><code>1978-01-01, 12.5, 6.3, 0, 0, 0.25, 0.45, 0.3, 0, 0, 0, 0.1, 0.9, 72
  </code></pre>
  
  <p>I have tried using:</p>
  
  <pre><code>j&lt;-unlist(input)
  output&lt;-matrix(j,nrow=nrow(input),ncol=length(j)/nrow(input))
  </code></pre>
  
  <p>But it messes up the order of the rows in the output.</p>
  
  <p>Any idea?</p>
  
  <p><strong>Additional information:</strong></p>
  
  <p>The above example is slightly simplified and <code>dput(head(input))</code> returns the following sample:</p>
  
  <pre><code>structure(list(DATE = structure(c(2924, 2925, 2926, 2927, 2928, 
  2929), class = "Date"), TEMP_MEAN_M0 = c(-7.625, -7.375, -6, 
  -5.5, -7.625, -9.625), SLP_MEAN_M0 = c(1012.125, 991.975, 989.825, 
  986.675, 988.95, 993.075), WIND_DIR_RF_M0 = structure(list(`2.counts` = c(0, 
  0.625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.125, 0, 0, 0, 0.125), `3.counts` = c(0.75, 
  0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), `4.counts` = c(0.375, 
  0.125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.125, 0.125, 0, 0, 0), `5.counts` = c(0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.125, 
  0, 0, 0.125, 0.375, 0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0), `6.counts` = c(0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.125, 
  0, 0.25, 0.125, 0.25, 0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0), `7.counts` = c(0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0.125, 0.5, 0.375, 0, 0, 0, 0, 0, 0, 0, 0, 0)), .Names = c("2.counts", 
  "3.counts", "4.counts", "5.counts", "6.counts", "7.counts")), 
      CEIL_HGT_RF_M0 = structure(list(`2.counts` = c(0.625, 0, 
      0, 0, 0, 0, 0, 0, 0, 0.375), `3.counts` = c(0.75, 0.125, 
      0, 0.125, 0, 0, 0, 0, 0, 0), `4.counts` = c(0.25, 0.125, 
      0, 0.125, 0, 0, 0, 0, 0.25, 0.25), `5.counts` = c(0, 0, 0, 
      0, 0, 0, 0, 0, 0.125, 0.875), `6.counts` = c(0, 0, 0, 0, 
      0, 0, 0, 0, 0, 1), `7.counts` = c(0, 0, 0, 0, 0, 0, 0, 0, 
      0, 1)), .Names = c("2.counts", "3.counts", "4.counts", "5.counts", 
      "6.counts", "7.counts")), WIND_SPD_MEAN_M0 = c(12.8125, 18.7375, 
      6.175, 8.175, 10.5375, 16.5375)), .Names = c("DATE", "TEMP_MEAN_M0", 
  "SLP_MEAN_M0", "WIND_DIR_RF_M0", "CEIL_HGT_RF_M0", "WIND_SPD_MEAN_M0"
  ), row.names = c(NA, 6L), class = "data.frame")
  </code></pre>