rbern: The Bernoulli Distribution

View source: R/bernoulliDist.R

rbernR Documentation

The Bernoulli Distribution

Description

#' [Stable]

Density, distribution function, quantile function and random generation for the benoulli distribution with parameter prob.

Usage

rbern(n, prob)

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

prob

probability of success of each trial

Value

A vector of 0's and 1's representing failure and success.

Examples

#Return a random result of a Bernoulli trial given `prob`.
rbern(n =1, prob = 0.5)

causact documentation built on April 12, 2025, 1:40 a.m.