title: dictionary and list comprehension in R
body: <p>Any generic way of doing the following R code faster? For example in python dict comprehension (see equivalent below) would be a nice faster alternative.</p>
  
  <p>R:</p>
  
  <pre><code>l1 &lt;- 1:3
  l2 &lt;- c("a", "b", "c")
  foo &lt;- function(x) {return(5*x)}
  bar &lt;- list()
  for (i in 1:length(l1)) bar[l2[i]] &lt;- foo(l1[i])
  </code></pre>
  
  <p>Python</p>
  
  <pre><code>l1 = range(1, 4)
  l2 = ["a", "b", "c"]
  def foo(x):
      return 5*x
  {b: foo(a) for a, b in zip(l1, l2)}
  </code></pre>