rolldie {probs} | R Documentation |
Rolling a Die
Description
Sets up a sample space for the experiment of rolling a die repeatedly.
Usage
rolldie(times, nsides = 6, makespace = FALSE)
Arguments
times |
number of rolls. |
nsides |
number of sides on the die. |
makespace |
logical. Include a column of equally likely probabilities if |
Details
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
.
Value
A data frame, with an equally likely probs
column if makespace
is TRUE
.
Author(s)
G. Jay Kerns gkerns@ysu.edu.
See Also
Examples
rolldie(2)
rolldie(3, nsides = 4)
rolldie(3, nsides = 4, makespace = TRUE)
[Package probs version 0.9.9 Index]