unroll: Display a Two-Dimension Version of a Matrix of Vectors
Description
Displays all values of a matrix of vectors by unrolling the
object vertically or horizontally.
Usage
unroll(x, bycol = FALSE, drop = TRUE)
Arguments
x
a list of vectors with a dim attribute of
length 0, 1 or 2.
bycol
logical; whether to unroll horizontally
(FALSE) or vertically (TRUE).
drop
logical; if TRUE, the result is coerced to the
lowest possible dimension.
Value
A vector or matrix.
Details
unroll returns a matrix where elements of x
are concatenated (unrolled) by row (bycol = FALSE) or
by column (bycol = TRUE). NA is used to make
rows/columns of equal length.
Vectors and one dimensional arrays are coerced to row
matrices.
See Also
This function was originally written for use in
severity.simpf.