title: Simulate 5000 samples of size 5 from a normal distribution with mean 5 and standard deviation 3
body: <p>I am trying to simulate 5000 samples of size 5 from a normal distribution with mean 5 and standard deviation 3. I want to then compute the mean of each sample and make a histogram of the sample means</p>
  
  <p>My current code is not giving me an error but I don't think it's right:</p>
  
  <pre><code>nrSamples = 5000
  e &lt;- list(mode="vector",length=nrSamples)
  for (i in 1:nrSamples) {
  e[[i]] &lt;- rnorm(n = 5, mean = 5, sd = 3)
  }
  
  sample_means &lt;- matrix(NA, 5000,1)
  for (i in 1:5000){
  sample_means[i] &lt;- mean(e[[i]])
  }
  </code></pre>
  
  <p>Any idea on how to tackle this? I am very very new to R!</p>