title: R list from variables using variable names
body: <p>I've looked extensively for a solution for this very simple task and though I have a solution, it seems like there must be a better way. The task is to create a list from a set of variables, using the variable names as names for each element in the list, e.g.:</p>
  
  <pre><code>a &lt;- 2
  b &lt;- 'foo'
  c &lt;- 1:4
  </code></pre>
  
  <p>My current solution:</p>
  
  <pre><code>named.list &lt;- function(...) { 
      l &lt;- list(...)
      names(l) &lt;- sapply(substitute(list(...)), deparse)[-1]
      l 
  }
  named.list(a,b,c)
  </code></pre>
  
  <p>Produces:</p>
  
  <pre><code>$a
  [1] 2
  
  $b
  [1] "foo"
  
  $c
  [1] 1 2 3 4
  </code></pre>