title: Generate n data frames and append to list
body: <p>I'm programming a box model with n layers. I want to generate a data frame for each layer I define in my box model and perform calculations in each column of each data frame. I've initialized the data frames using this code:</p>
  
  <pre><code>##Initialize layer energy+water balance dataframes
  calcs &lt;- c("Vwin", "Vwout", "Vsin","Vsout","Pistd","Vwnet","Psin","Psout","Vw","Vemax","Sw","Cp","Kt","Qwout","Qtop","Qbot","Qsides","Qnet","Tavg")
  layer_tabs&lt;-list()
  
  for(i in 2:(layers-1)){
    nam &lt;- paste("layer_",i,sep = "")
    assign(nam,data.frame(matrix(vector(),t,length(calcs),dimnames = list(c(),calcs))))
    append(layer_tabs, nam=nam)
  }
  </code></pre>
  
  <p>Now for each column named in my calcs vector I need to perform a specific calculation in each layer data frame. I want to either append the layer data frames as they are generated to a list that I can loop through or use an apply function on and then write functions/equations for each column OR loop through the data frames by using the number in their variable name. My attempt to append the data frames as they were generated to the empty list "layer_tabs" returned the error:</p>
  
  <pre><code>Error in append(layer_tabs, nam = nam) : unused argument (nam = nam)
  </code></pre>