collapse_mat_list: Collapse a list of matrices

View source: R/aux_fns.R

collapse_mat_listR Documentation

Collapse a list of matrices

Description

Collapse a list of square matrices into a matrix where each row contains the column-wise vectorization of one of the original matrices.

Usage

collapse_mat_list(Alist)

Arguments

Alist

A list of matrices, of any length.

Value

A matrix where each row contains the column-wise vectorization of one of the original matrices.

Examples

A1<- matrix(data=c(0,0.8,0, 0,0,0.7, 5,0,0.2), nrow=3, ncol=3)
A2<- matrix(data=c(0,0.9,0, 0,0,0.5, 4,0,0.3), nrow=3, ncol=3)
A3<- matrix(data=c(0,0.4,0, 0,0,0.6, 6,0,0.25), nrow=3, ncol=3)
A_all<- collapse_mat_list(list(A1, A2, A3))

chrissy3815/exactLTRE documentation built on July 1, 2023, 8:30 a.m.