unlist_bind: Convert list of lists into list of arrays.

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert list of lists into list of arrays.

Usage

1
unlist_bind(x, name, bind)

Arguments

x

List of (named) lists.

name

Character vector of inner list elements to bind. If missing defaults to every element of the inner list.

bind

List of binding functions (e.g., c, cbind, etc.) the same length as name. If missing defaults to rep(c, length(name)).

Value

A named list with elements corresponding to the binded values of the inner elements of x.

Examples

1
2
3
4
5
6
7
# generate a list of lists
Phi <- replicate(5, {
  list(lambda = rnorm(3), Omega = diag(rnorm(3)),
       nu = rexp(1), tau = rexp(1))
}, simplify = FALSE)

unlist_bind(Phi, bind = c(cbind, rbind, c, c))

mlysy/losmix documentation built on Jan. 18, 2021, 5:56 a.m.