- 1
- Set the seed once, so we get the same “random” rolls every time the slides are made.
- 2
- Save the number of simulations and the number of dice as named values, so they are easy to change later.
- 3
-
Same setup as Lesson 2: one row for every combination of simulation and die. The pipe
|>passes the table to the next line. - 4
-
mutate()adds a column calledroll.n()is the number of rows, so every row gets one random roll from 1 to 4.
