rolldie | R Documentation |
Sets up a sample space for the experiment of rolling a die repeatedly.
rolldie(times, nsides = 6, makespace = FALSE)
times |
number of rolls. |
nsides |
number of sides on the die. |
makespace |
logical. Include a column of equally likely probabilities if |
The function uses expand.grid()
to generate all possible rolls resulting from the experiment of rolling a die. Sides on the die are 1:nsides
. Columns of the data frame are called X1
, X2
, up to Xtimes
.
A data frame, with an equally likely probs
column if makespace
is TRUE
.
G. Jay Kerns gkerns@ysu.edu.
tosscoin
rolldie(2)
rolldie(3, nsides = 4)
rolldie(3, nsides = 4, makespace = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.