Generates a set of Bernoulli distributed values.
r_bern(prob = 0.5, ..., n = default_n(prob), .seed = NULL)
prob | vector of probability of successes, between 0 & 1 |
---|---|
... | Unused |
n | number of observations to generate. The |
.seed | One of the following:
To extract the random seed from a previously generated set of
values, use |
A numeric vector of length n
#> [1] 1 1 1 1 1#> [1] 0 0 1 0 0 1 1 1 0 1 1r_bern(1 / 4, n = 10)#> [1] 0 1 1 0 0 1 0 0 0 0