Last chance! 50% off unlimited learning
Sale ends in
Forms a probability space from a set of outcomes and (optional) vector of probabilities.
probspace(x, …)# S3 method for default
probspace(x, probs, …)
# S3 method for list
probspace(x, probs, …)
a vector, data frame, or list of outcomes.
a vector of non-negative weights of the same length as outcomes
further arguments to be passed to or from other methods.
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.
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.
# NOT RUN {
R <- rolldie(3)
probspace(R)
# }
Run the code above in your browser using DataLab