View source: R/reorganise_matrices.R
reorganise_matrices | R Documentation |
This function reorganises a list of matrix population models, which are split
into mat_A
, mat_U
, mat_F
, and optionally mat_C
sub-matrices. It prepares the matrices for easy conversion into a
compadreDB
object.
reorganise_matrices(matrix_list)
matrix_list |
A list of lists, where each sub-list contains the matrices
|
This function processes a list of matrix population models,
extracting and grouping the sub-matrices (mat_A
, mat_U
,
mat_F
, and optionally mat_C
) into separate lists. If a
mat_C
matrix is not present in a model, an NA
matrix of the
same size as mat_U
is used as a placeholder.
A list containing four elements: mat_A
, mat_U
,
mat_F
, and mat_C
. Each element is a list of matrices
corresponding to the respective matrix type from the input. If mat_C
does not exist in a sub-list, it is replaced with an NA
matrix of
the same dimensions as mat_U
.
Owen Jones jones@biology.sdu.dk
Other Leslie matrices:
make_leslie_mpm()
,
rand_leslie_set()
# Example usage
matrix_list <- list(
list(
mat_A = matrix(1, 2, 2),
mat_U = matrix(2, 2, 2),
mat_F = matrix(3, 2, 2),
mat_C = matrix(4, 2, 2)
),
list(
mat_A = matrix(5, 2, 2),
mat_U = matrix(6, 2, 2),
mat_F = matrix(7, 2, 2)
)
)
reorganised_matrices <- reorganise_matrices(matrix_list)
reorganised_matrices$mat_A
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.