Learn R Programming

clttools (version 1.3)

dice.plot: Theoretical Probability Distribution Plot of Rolling Dice

Description

Probability plot of rolling fair or loaded dice

Usage

dice.plot(n, prob = NULL, col = "black", type = NULL, main = NULL, sub = NULL)

Arguments

n
number of trials
prob
probability assigned to each possible outcome
col
color of the plot
type
type of plot
main
an overall title for the plot
sub
a sub title for the plot

Value

Plot of mean value and corresponding probabilities for all possible outcomes.

Details

The default probabilty equals to 1/n. All the assigned probabilites must between 0 and 1.

Examples

Run this code
dice.plot(n = 4, col ='red', type = 'p')
dice.plot(3, prob = c(0.3, 0.1, 0.2, 0.1, 0.1, 0.2))

Run the code above in your browser using DataLab