Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 665 Bytes

File metadata and controls

19 lines (11 loc) · 665 Bytes

Setting the seed

  • set.seed()

Computers in general, and R specifically, can, in fact, only provide pseudo random number generators.

They generate numbers according to an algorithm, and, given the same 'seed', it will output the same numbers, i.e. repeat exactly the same simulation.

This is useful for sharing code and reproduce simulations, as well as for debugging code.


YOUR TURN:
In your local exercice script:
Play around with the function set.seed() by running and modifying the examples provided (e.g. compare outputs with and without seeds, change the seed number)


Previous | Next