title: preallocate list in R
body: <p>It is inefficient in R to expand a data structure in a loop.  How do I preallocate a <code>list</code> of a certain size? <code>matrix</code> makes this easy via the <code>ncol</code> and <code>nrow</code> arguments.  How does one do this in lists?  For example:</p>
  
  <pre><code>x &lt;- list()
  for (i in 1:10) {
      x[[i]] &lt;- i
  }
  </code></pre>
  
  <p>I presume this is inefficient.  What is a better way to do this?</p>