title: Get names of list in for loop
body: <p>In PHP you can access both the names and values of an array in a for loop with </p>
  
  <pre><code>foreach ( $array as $key =&gt; $value ) {
  </code></pre>
  
  <p>Is there anything comparable in R, when looping over named lists?</p>