title: Building a list in a loop in R - getting item names correct
body: <p>I have a function which contains a loop over two lists and builds up some calculated data.  I would like to return these data as a lists of lists, indexed by some value, but I'm getting the assignment wrong.</p>
  
  <p>A minimal example of what I'm trying to do, and where i'm going wrong would be:</p>
  
  <pre><code>mybiglist &lt;- list()
  for(i in 1:5){
      a &lt;- runif(10)
      b &lt;- rnorm(16)
      c &lt;- rbinom(8, 5, i/10)
      name &lt;- paste('item:',i,sep='')
      tmp &lt;- list(uniform=a, normal=b, binomial=c)
      mybiglist[[name]] &lt;- append(mybiglist, tmp)
  }
  </code></pre>
  
  <p>If you run this and look at the output mybiglist, you will see that something is going very wrong in the way each item is being named.</p>
  
  <p>Any ideas on how I might achieve what I actually want?</p>
  
  <p>Thanks</p>
  
  <p>ps. I know that in R there is a sense in which one has failed if one has to resort to loops, but in this case I do feel justified ;-)</p>