Density, distribution function, quantile function and random generation for the Bernoulli distribution.
dbern(x, prob, log = FALSE)qbern(p, prob, lower.tail = TRUE, log.p = FALSE)
pbern(q, prob, lower.tail = TRUE, log.p = FALSE)
rbern(n, prob)
numeric. Vector of quantiles.
Probability of success on each trial.
logical. If TRUE
, probabilities p
are given as log(p)
.
numeric in [0, 1]
. Vector of probabilities.
logical. If TRUE
(default),
probabilities are P[X <= x]
, otherwise, P[X > x]
.
logical. If TRUE
, probabilities p
are given as log(p)
.
numeric. Vector of quantiles.
number of observations.
If length(n) > 1
, the length is taken to be the number required.
See the help page of the Binomial
distribution.