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)


zhenkewu/slamR documentation built on March 8, 2020, 1:31 a.m.