rep.Distribution: Replicate Distribution into Vector, Mixture, or Product

View source: R/rep.Distribution.R

rep.DistributionR Documentation

Replicate Distribution into Vector, Mixture, or Product

Description

Replicates a constructed distribution into either a

  • VectorDistribution (class = "vector")

  • ProductDistribution (class = "product")

  • MixtureDistribution (class = "mixture")

If the distribution is not a custom Distribution then uses the more efficient distribution/params constructor, otherwise uses distlist.

Usage

## S3 method for class 'Distribution'
rep(x, times, class = c("vector", "product", "mixture"), ...)

Arguments

x

Distribution

times

(integer(1)) Number of times to replicate the distribution

class

(character(1)) What type of vector to create, see description.

...

Additional arguments, currently unused.

Examples

rep(Binomial$new(), 10)
rep(Gamma$new(), 2, class = "product")


alan-turing-institute/distr6 documentation built on Feb. 26, 2024, 11 a.m.