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

Description Usage Arguments Author(s) Examples

Description

Print a random variable of class "RV"

Usage

1
2
3
## S3 method for class 'RV'
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

Author(s)

Eric Hare erichare@iastate.edu

Examples

1
2
fair.die <- RV(1:6, rep(1/6,6))
print(fair.die)

Example output

Attaching package:discreteRVThe following object is masked frompackage:base:

    %in%

Random variable with 6 outcomes

sh: 1: rm: Permission denied
Outcomes   1   2   3   4   5   6
Probs    1/6 1/6 1/6 1/6 1/6 1/6

discreteRV documentation built on May 2, 2019, 11:04 a.m.