rvbern: Sample a vector of Bernoulli variables.

Description Usage Arguments Value

View source: R/simulate.R

Description

Sample a vector of Bernoulli variables with higher speed (same length with "p"). The Bernoulli random variables can have different means.

Usage

1
rvbern(p)

Arguments

p

A vector of probabilities, each being the head probability of an independent coin toss

Value

A vector of 1s (head) and 0s (tail)


oslerinhealth/slamR documentation built on May 23, 2021, 5:33 a.m.