Generates a set of Binomial distributed values.
r_binom(size, prob = 0.5, ..., n = default_n(size, prob), .seed = NULL)
size | vector of number of trials, positive integer |
---|---|
prob | vector of probabilities of success on each trial, 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] 4 7 6 3 7r_binom(1:10)#> [1] 1 1 3 2 4 2 1 3 6 4r_binom(10, 0.2)#> [1] 1 0 4 1 3r_binom(1, 0.2, n = 10)#> [1] 0 1 0 1 0 0 1 0 0 0