Learn R Programming

distr6 (version 1.6.9)

c.Matdist: Combine Matrix Distributions into a Matdist

Description

Helper function for quickly combining distributions into a Matdist.

Usage

# S3 method for Matdist
c(...)

Arguments

...

matrix distributions to be concatenated.

Value

Matdist

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab