title: R: Name a data.frame after a value in a vector
body: <p>I am trying to create a data.frame within a for loop. I want to name the data.frame after whatever the value is in the vector for that iteration of the loop. </p>
  
  <p>The vector comes from the <code>City</code> column in the <code>State</code> data.frame:</p>
  
  <pre><code>State
  
  City  Zip
  A     1  
  B     2
  C     3
  </code></pre>
  
  <p>What I have tried:</p>
  
  <pre><code>for( i in State$City){
  
  i &lt;- data.frame(sub=character(),street=character())
  }
  </code></pre>
  
  <p>This will name the data.frame <code>i</code> not the value in the vector. </p>
  
  <pre><code>i
  
  sub   street
  </code></pre>
  
  <p>If it was the first iteration in the loop then I would want the name of the data.frame to be  <code>A</code> </p>
  
  <pre><code>A
  
  sub   street
  </code></pre>
  
  <p>If second iteration then <code>B</code> </p>
  
  <p>If third iteration then <code>C</code></p>
  
  <p>Any help will be appreciated please let me know if any further information is needed.</p>