Learn R Programming

purrr (version 0.2.3)

rbernoulli: Generate random sample from a Bernoulli distribution

Description

Generate random sample from a Bernoulli distribution

Usage

rbernoulli(n, p = 0.5)

Arguments

n

Number of samples

p

Probability of getting TRUE

Value

A logical vector

Examples

Run this code
# NOT RUN {
rbernoulli(10)
rbernoulli(100, 0.1)
# }

Run the code above in your browser using DataLab