Description Usage Arguments Details Value See Also Examples
Create an instance of the Dice S4 class, allowing for the use of non-standard dice and for interactive dice rolling without having to recur to functions of the roll family. See below for more details.
1 | d(faces)
|
faces |
Either the number of faces ( |
If given a numeric vector, d()
creates an object of the Dice S4 class
representing a die with these values for faces. On the other hand, if given
a numeric scalar, it creates a die with faces running from 1 to this value.
At the moment, there is no support for specifying each face's probability,
although it is possible to create a die where more than one face have the
same value.
This function has two main purposes: creating non-standard dice and allowing
for interactive dice rolling. Non-standard dice are arbitrary objects that
might not have a real world counterpart, e.g., a d(17)
or a
d(c(1, 1, 3))
. Interactive rolling is the ability to get a random result
from a die without having to resort to functions of the roll family,
explained in detail in the documentation for the Dice S4 class.
An object of the Dice S4 class.
Dice, roll.
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.