Learn R Programming

purrr (version 0.1.0)

rbernoulli: Generate random samples from a Bernoulli distribution

Description

Generate random samples 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
rbernoulli(10)
rbernoulli(100, 0.1)

Run the code above in your browser using DataLab