Learn R Programming

discreteRV (version 1.2.2)

print.RV: Print a random variable of class "RV"

Description

Print a random variable of class "RV"

Usage

"print"(x, odds = attr(x, "odds"), fractions = attr(x, "fractions"), all.outcomes = FALSE, digits = 3, ...)

Arguments

x
A random variable
odds
If TRUE, print as odds instead of probs
fractions
If TRUE, print probs as fractions instead of decimals
all.outcomes
If TRUE, print all outcomes rather than the first ten
digits
Number of digits to print for probabilities
...
Additional arguments to be passed to the "format" function

Examples

Run this code
fair.die <- RV(1:6, rep(1/6,6))
print(fair.die)

Run the code above in your browser using DataLab