title: How to use "paste" to refer to a dataframe column
body: <p>I want to write a for loop that "grabs" data from already existing data frames, and stores them in a vector. However, I cannot determine how to use the paste function to get R to access column ohm.2 row 37 in the dataframe.</p>
  
  <p>Here is my best attempt:</p>
  
  <pre><code>for(i in 6:18){
    vec = numeric(4)
    for(n in 1:4){
      path &lt;- paste("dat_",i,"_",n,"$ohm.2[37]")
      val &lt;- path
      vec[n] &lt;- val
    }
    assign(paste0("dat_",i),vec)
  }
  </code></pre>
  
  <p>In this attempt, I get vectors correctly named, but instead of storing the number in row 37 column ohm.2 for each dataframe, it just stores the text:</p>
  
  <pre><code>[1] "dat_ 10 _ 1 $ohm.2[37]" "dat_ 10 _ 2 $ohm.2[37]"
  [3] "dat_ 10 _ 3 $ohm.2[37]" "dat_ 10 _ 4 $ohm.2[37]"
  </code></pre>