title: How it is storing more index values in it?
body: <p>While running a for loop, I came across a problem: </p>
  
  <pre><code>d = data.frame(X = rbeta(20000, 2, 5))
  
  k = numeric(10000)
  for (i in 1:10000){
    j = sample(d$X, 100)
    k[i] = mean(j)
  }
  </code></pre>
  
  <p>I have two questions </p>
  
  <ol>
  <li>How the shapes (2, 5) works in <strong>rbeta</strong> </li>
  <li>Here when the mean(j) (which has 100 samples in it) is stored in k then why k when printing showing 10000 values to me. I hope you understand my question </li>
  </ol>