
Last chance! 50% off unlimited learning
Sale ends in
Probability mass function, distribution function, quantile function and random generation for the Bernoulli distribution.
dbern(x, prob = 0.5, log = FALSE)pbern(q, prob = 0.5, lower.tail = TRUE, log.p = FALSE)
qbern(p, prob = 0.5, lower.tail = TRUE, log.p = FALSE)
rbern(n, prob = 0.5)
vector of quantiles.
probability of success; (0 < prob < 1
).
logical; if TRUE, probabilities p are given as log(p).
logical; if TRUE (default), probabilities are
vector of probabilities.
number of observations. If length(n) > 1
,
the length is taken to be the number required.
# NOT RUN {
prop.table(table(rbern(1e5, 0.5)))
# }
Run the code above in your browser using DataLab