title: Assign column names to list of dataframes
body: <p>I have a list of dataframes, whose columns have names. </p>
  
  <p>If I want to change the names of the dataframes within the list (rather than the names of the parent list), I cannot access them directly via names() or colnames(), rather I must use lapply() to get the names.</p>
  
  <p>However, if I use lapply to return the column names, then they only exist within the lapply call, and I cannot assign new names to the list in the parent environment.</p>
  
  <p>Here's a MWE below:</p>
  
  <p><em>1/ Create the object</em></p>
  
  <pre><code>require(xts)
  data(sample_matrix)
  x &lt;- as.xts(sample_matrix)
  y &lt;- lapply(split(x, "months"), data.frame)
  </code></pre>
  
  <p><em>2/ The column names of the dataframes are not directly accessible</em></p>
  
  <pre><code>names(y)
  </code></pre>
  
  <blockquote>
    <p>NULL</p>
  </blockquote>
  
  <pre><code>colnames(y)
  </code></pre>
  
  <blockquote>
    <p>NULL</p>
  </blockquote>
  
  <p><em>3/ We can try to use lapply</em></p>
  
  <pre><code>lapply(y, function(z) names(z) &lt;- c('Op', 'Hi', 'Lo', 'Clo'))
  </code></pre>
  
  <blockquote>
    <p>[[1]]</p>
    
    <p>[1] "Op"  "Hi"  "Lo"  "Clo" ...</p>
  </blockquote>
  
  <p>But it hasn't actually assigned names to the object.</p>