probspace {prob} | R Documentation |
Forms a probability space from a set of outcomes and (optional) vector of probabilities.
probspace(x, ...) ## Default S3 method: probspace(x, probs, ...) ## S3 method for class 'list': probspace(x, probs, ...)
x |
a vector, data frame, or list of outcomes. |
probs |
a vector of non-negative weights of the same length as outcomes |
... |
further arguments to be passed to or from other methods. |
The elements of probs
will be normalized to ensure that their sum is one. If probs
is not specified, then the equally likely model is assumed in which every outcome has the same probability.
If outcomes
is a vector or data frame, then the value is a data frame with
an added probs
column. If outcomes
is a list, then the value is a list with
components outcomes
(the supplied list) and a probs
component.
G. Jay Kerns gkerns@ysu.edu.
R <- rolldie(3) probspace(R)