c.Matdist: Combine Matrix Distributions into a Matdist

View source: R/SDistribution_Matdist.R

c.MatdistR Documentation

Combine Matrix Distributions into a Matdist

Description

Helper function for quickly combining distributions into a Matdist.

Usage

## S3 method for class 'Matdist'
c(...)

Arguments

...

matrix distributions to be concatenated.

Value

Matdist

Examples

# create three matrix distributions with different column names
mats <- replicate(3, {
  pdf <- runif(200)
  mat <- matrix(pdf, 20, 10, FALSE, list(NULL, sort(sample(1:20, 10))))
  mat <- t(apply(mat, 1, function(x) x / sum(x)))
  as.Distribution(mat, fun = "pdf")
})
do.call(c, mats)

distr6 documentation built on March 28, 2022, 1:05 a.m.