title: R - Problems creating dataframe from sapply results that combine lists
body: <p>I'm trying to create a dataframe from the results of sapply.</p>
  
  <p>The variable fits is a collection of nls objects, all with the same names for coefficients. I am able to create a dataframe where the vectors are the coefficients and the rows are the individual fits using this:</p>
  
  <pre><code>Coefficients &lt;- sapply(fits,function(x){coef(x)},simplify = TRUE,USE.NAMES = TRUE)
  Coefficients_df &lt;- data.frame(t(Coefficients))
  </code></pre>
  
  <p>This works fine and when I do summary(Coefficients_df), I get what I expect, the normal summary of a dataframe with 3 columns.</p>
  
  <p>But what I want is to have a dataframe that includes the coefficients and the average error for each fit. I can get a matrix using this:</p>
  
  <pre><code>Coef_and_Error &lt;- sapply(fits,function(x){c(coef(x),list(error = summary(x)$sigma))},simplify = TRUE,USE.NAMES = TRUE)
  </code></pre>
  
  <p>But then I do not get a proper dataframe using this:</p>
  
  <pre><code>Coef_and_Error_df &lt;- data.frame(t(Coef_and_Error))
  </code></pre>
  
  <p>RStudio reports this as a dataframe (4105 obs. of 4 variables), but when I try to see a summary of the dataframe, it spews out a long list of "1  -none- numeric", flooding the console.</p>
  
  <p>Also, when I click the triangle next to "Coef_and_Error_df"in Rstudio it does not show the sort of summary I'm used to. Instead of a simple summary with one row per column (e.g. k num 233 189 391 ...) It says "k: list of 4105"</p>
  
  <p>I have been able to get the output I want by creating two separate matrices, converting both to dataframes and adding one as a new vector to the other, but that shouldn't be necessary.</p>
  
  <p>I tried using "append" instead of "c" to combine the values, but no luck.</p>