rbinom_vec.Rd
This function samples from binomial distribution using a vector of probabilities.
rbinom_vec(probs)
a binary vector of binomial observations corresponding to provided probabilities.
probs <- runif(100)
rbinom_vec(probs)
#> [1] 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0
#> [38] 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 0 0 1
#> [75] 1 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1