Helper function for quickly combining distributions into a Arrdist.
# S3 method for class 'Arrdist'
c(..., decorators = NULL)
# 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)
#> Arrdist(60x20x2)