title: Extract column name to vector by calling the column name
body: <p>We have a <code>data.frame</code>here: </p>
  
  <pre><code>df &lt;- data.frame(x1=rnorm(20),x2=rnorm(20),x3=rnorm(20),x4=rnorm(20),x5=rnorm(20),x6=rnorm(20),x7=rnorm(20),x8=rnorm(20),x9=rnorm(20),x10=rnorm(20),x11=rnorm(20),x12=rnorm(20),x13=c(2,1,1,2,2,1,2,1,2,2,1,1,2,1,2,2,1,2,1,1))
  </code></pre>
  
  <p>I know I can view the column names easily with</p>
  
  <pre><code>colnames(df)
  [1] "x1"  "x2"  "x3"  "x4"  "x5"  "x6"  "x7"  "x8"  "x9"  "x10" "x11" "x12" "x13"
  </code></pre>
  
  <p>Which prints the line above.</p>
  
  <p>I can also get the name of a single column with <code>colnames(df[...])</code>, for an example</p>
  
  <pre><code>colnames(df[2])
  [1] "x2"
  </code></pre>
  
  <p>I can't seem to figure out how to extract a single column name by calling <code>colnames()</code> with the name of the column, like</p>
  
  <pre><code>colnames(df$x2)
  NULL
  </code></pre>
  
  <p>I bet the solution is ridiculously simple, but I just haven't found any useful information regarding this issue.</p>