Skip to contents

Returns the sum of bernoulli variables with different probabilities.

Usage

rbern(N, prob)

Arguments

N

Number of random variates to generate.

prob

Vector of probabilities.

Examples

rbern(5, c(.3, .6, .1))
#> [1] 0 2 1 1 1