random: Draw a random sample from a probability distribution

Description Usage Arguments Examples

View source: R/methods.R

Description

Draw a random sample from a probability distribution

Usage

1
random(x, n = 1L, ...)

Arguments

x

A probability distribution object such as those created by a call to Bernoulli(), Beta(), or Binomial().

n

The number of samples to draw. Should be a positive integer. Defaults to 1L.

...

Unused. Unevaluated arguments will generate a warning to catch mispellings or other possible errors.

Examples

1
2
3
X <- Normal()

random(X, 10)

distributions3 documentation built on Jan. 4, 2022, 1:07 a.m.