title: Loop through individual data frames and add new column
body: <p>I would like to loop through individual data frames (not in a list) and append a column to each df so that the appended column is a copy of column one in the original df. </p>
  
  <p>For df x: </p>
  
  <pre><code>&gt; x
    V1 V2 V3
  1  1  2  3
  2  1  2  3
  3  1  2  2
  4  1  2  2
  5  1  1  1
  </code></pre>
  
  <p>Desired output would be:</p>
  
  <pre><code>&gt; x
    V1 V2 V3 newCol
  1  1  2  3  1
  2  1  2  3  1
  3  1  2  2  1
  4  1  2  2  1
  5  1  1  1  1
  </code></pre>
  
  <p>I tried using this loop:</p>
  
  <pre><code>filenames &lt;- names(which(sapply(.GlobalEnv, is.data.frame)))
  for(x in seq_along(filenames)){
    filenames[x]$newCol  &lt;-   x[,1]
  }
  </code></pre>
  
  <p>but error occurs:</p>
  
  <blockquote>
    <p>Error in x[, 1] : incorrect number of dimensions</p>
  </blockquote>