Description Usage Arguments Details Value Source See Also Examples

Density, distribution function, quantile function, and random generation for the discrete distribution described by a roll expression. See below for more details.

1 2 3 4 5 6 7 |

`x` |
A numeric vector of outcomes. |

`roll` |
A roll expression (e.g., |

`q` |
A numeric vector of outcomes. |

`lower.tail` |
Whether to calculate |

`p` |
A numeric vector of probabilities. |

`n` |
Number of random deviates to return. |

Given a roll expression (i.e., an arithmetic expression involving dice),
`r()`

calculates the complete distribution of the outcomes. This is possible
because the distribution is discrete and has a finite number of outcomes.

From this distribution, `droll()`

returns the density, `proll()`

returns the
distribution function, `qroll()`

returns the quantile function, and
`rroll()`

generates random deviates. They mirror functions from the
Distributions family.

For more details on roll expressions, see `r()`

and the Dice S4 class.

A numeric vector.

The main algorithm for calculating dice probabilities comes from MathWorld.

Symbolic calculations are handled by Ryacas, and, by extension, by Yacas.

`r()`

, Dice, roll-plot.

1 2 3 4 5 6 7 8 9 10 11 12 13 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.