rvbern: Sample a vector of Bernoulli variables.

Description Usage Arguments Value

View source: R/utils.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/baker documentation built on May 22, 2021, 12:05 p.m.