title: R - How to access a data frame using a dynamic name?
body: <p>I'm stuck on R because can't figure out how to point to a specific data frame (but could be any type) by its name. This is because I need to combine data from different sources. See the example below:</p>
  
  <ul>
  <li><p>data is split based on cities. The data frames have different amounts of rows and columns. The exact structure of each df isn't important here.</p>
  
  <ul>
  <li>df_city1 &lt;- rows = 500, columns = 12</li>
  <li>df_city2 &lt;- rows = 10, columns = 23</li>
  <li>df_city3 &lt;- rows = 100, columns = 19</li>
  <li>df_city4 &lt;- rows = 33, columns = 12</li>
  <li>df_city5 &lt;- rows = 24, columns = 9</li>
  </ul></li>
  <li><p>now I'll run over another data frame, call it df_master, which includes the names (as string) 'df_city1' until 'df_city5' in a certain column. Depending on the value of that particular 'city' column, a value has to be changed in one of the 5 data frames mentioned above.</p></li>
  <li><p>so basically I need the value of df_master$city to point to the data frame mentioned under the first bullet. Something like</p></li>
  </ul>
  
  <p>(df_master$city)[3] &lt;- .....</p>