title: How to access the name of a column which is a number through a variable
body: <p>Problem : I can't select the column of a dataframe through a variable if the column is a number. Example:</p>
  
  <pre><code>library(dplyr)
  df = data.frame(a=c(1,2,3),b=c(4,5,6)) #Create a dataframe
  
  colnames(df) &lt;- c("99","66") #Column names are numbers (let's say the id of something)
  </code></pre>
  
  <p>I can do this:</p>
  
  <pre><code>print(df$`99`[1])
  </code></pre>
  
  <p>But I can't do this:</p>
  
  <pre><code>k &lt;- 99
  print(df$`k`[1])
  </code></pre>
  
  <p>The reason I'm trying to use a variable to access the column name is that I want to loop over the column names:</p>
  
  <pre><code>for (i in colnames(df)){
    df$"i"
    df[,i]
  }
  </code></pre>