P: Compute the probability that an event occurs.

Description Usage Arguments Value Examples

View source: R/probability.R

Description

Compute the probability that an event occurs.

Usage

1
P(x)

Arguments

x

an event. An event is a special type of discrete random variable that only has two outcomes: TRUE or FALSE. It is usually created by applying a comparison operator to a random variable.

Value

a probability (numeric vector of length 1) between 0 and 1.

Examples

1
2
3
wheel <- rv(1:20)
P(wheel > 10)
P(wheel %% 2 == 0)

hadley/rv2 documentation built on May 17, 2019, 12:16 p.m.