Learn R Programming

discreteRV (version 1.2.2)

as.RV: Turn a probability vector with possible outcome values in the 'names()' attribute into a random variable:

Description

Turn a probability vector with possible outcome values in the 'names()' attribute into a random variable:

Usage

as.RV(px, fractions = TRUE)

Arguments

px
A probability vector with possible outcome values in the 'names()' attribute
fractions
If TRUE, return the probabilities as fractions