title: How to create a loop for generate a list of random samples in R?
body: <p>I'm trying to create a loop that creates a series of objects that contains a random sample, like this:</p>
  
  <pre><code>sample &lt;- ceiling(runif(9, min=0, max=20))
  </code></pre>
  
  <p>(This is an example for a rounded uniform, but it can be replaced by a normal, poisson or whatever you want).</p>
  
  <p>So, I built a loop for generate automatically various of those generators, with the objective of include them in a data frame. Then, the loop I designed was this:</p>
  
  <pre><code>N=50
  dep=as.vector(N)
  count=1
  for (i in 1:N){
      dep[count] &lt;- ceiling(runif(9, min=0, max=20))  
      count=count+1
  }
  </code></pre>
  
  <p>But it didn't work! For each dep[i] I have only a number, not a list of nine.</p>
  
  <p>How I should do it? And if I want to include every dep[i] in a data frame?</p>
  
  <p>Thanks so much, I hope you understand what i want.</p>