Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 690 Bytes

File metadata and controls

18 lines (12 loc) · 690 Bytes

Repetition

The function

  • replicate(nrep, expression) repeats the expression provided nrep times.

    • e.g. replicate(10, mean(rnorm(100))) reads: 'draw 100 values from a normal distribution a mean 0 and sd 1, caclulate their mean, do that 10 times.'

YOUR TURN:
In your local exercice script:
Replicate 1000 times the mean of 10 values drawn from a unifrom distribution between 0 and 10.
Replicate 100 times the mean of 50 values drawn from a normal distribution of mean 10 and stndard deviation 5.
Make a histogram of each of your results, are the distributions looking as expected?


Previous | Next