Learn R Programming

distributional (version 0.9.0)

generate.distribution: Randomly sample values from a distribution

Description

[Stable]

Generate random samples from probability distributions.

Usage

# S3 method for distribution
generate(x, times, ...)

Arguments

x

The distribution(s).

times

The number of samples. A scalar is broadcast to every distribution. Per-distribution sample sizes must be given as a list containing a single vector (list(c(...))) recycled against the distributions (length 1 or length(x)) - a bare vector of length > 1 is deprecated for this, as it is ambiguous with mapping the same vector onto every distribution.

...

Additional arguments used by methods.

See Also

vignette("broadcasting", package = "distributional") for how the times argument is combined with the distributions.