Random generation for the Bernoulli distribution with parameter prob
.
Source
Based on the rbinom function, with size = 1
.
Arguments
- n
number of observations. If
length(n) > 1
, the length is taken to be the number required.- prob
probability of success on each trial.
See also
Distributions for other standard distributions, including dbinom for the binomial.