c.Arrdist: Combine Array Distributions into a Arrdist

View source: R/SDistribution_Arrdist.R

c.ArrdistR Documentation

Combine Array Distributions into a Arrdist

Description

Helper function for quickly combining distributions into a Arrdist.

Usage

## S3 method for class 'Arrdist'
c(..., decorators = NULL)

Arguments

...

array distributions to be concatenated.

decorators

If supplied then adds given decorators, otherwise pulls them from underlying distributions.

Value

Arrdist

Examples

# create three array distributions with different column names
arr <- replicate(3, {
  pdf <- runif(400)
  arr <- array(pdf, c(20, 10, 2), list(NULL, sort(sample(1:20, 10)), NULL))
  arr <- aperm(apply(arr, c(1, 3), function(x) x / sum(x)), c(2, 1, 3))
  as.Distribution(arr, fun = "pdf")
})
do.call(c, arr)

RaphaelS1/distr6 documentation built on Feb. 24, 2024, 9:14 p.m.