Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

rbernoulli(10)
rbernoulli(100, 0.1)

purrr

Functional Programming Tools

v0.3.4
GPL-3 | file LICENSE
Authors
Lionel Henry [aut, cre], Hadley Wickham [aut], RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.