title: Iterate over key/value pair from a list()
body: <p>I'd like to know how I can iterate over a key/value pair from a list object in R, like the example below:</p>
  
  <pre><code>toto &lt;- list(a="my name is",b="I'm called",c="name:")
  myfun &lt;- function(key,value) paste(value,key)
  for( key in names(toto) ) toto[key] &lt;- myfun(key,toto[[key]])
  </code></pre>
  
  <p>Is there a way to avoid the for loop (using lapply() or such). Would it be faster?</p>
  
  <p>Thanks!</p>