Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mpm_rearrange

Rearrange stages of a matrix population model to segregate reproductive and non-reproductive stages


Description

Rearrange stages of a matrix population model so that all inter-reproductive stages fall in the final rows/columns of the matrix. This is a preparatory step to collapsing the matrix model into a standardized set of stages (e.g. propagule, pre-reproductive, reproductive, and post-reproductive).

Usage

mpm_rearrange(matU, matF, matC = NULL, repro_stages, matrix_stages)

Arguments

matU

The survival component of a matrix population model (i.e. a square projection matrix reflecting survival-related transitions; e.g. progression, stasis, and retrogression)

matF

The sexual component of a matrix population model (i.e. a square projection matrix reflecting transitions due to sexual reproduction)

matC

The clonal component of a matrix population model (i.e. a square projection matrix reflecting transitions due to clonal reproduction). Defaults to NULL, indicating no clonal reproduction (i.e. matC is a matrix of zeros).

repro_stages

Logical vector of length ncol(matU) indicating which stages are reproductive. Alternatively, a vector of stage indices or stage names of the reproductive classes.

matrix_stages

A character vector identifying organized matrix stages.

Value

Returns a list with 6 elements:

matU

Rearranged survival matrix

matF

Rearranged sexual reproduction matrix

matC

Rearranged clonal reproduction matrix

matrix_stages

Rearranged vector of organized matrix stages

repro_stages

Rearranged logical vector of reproductive stages

nonRepInterRep

Numeric index for any rearranged inter-reproductive stages

Author(s)

Rob Salguero-Gómez <rob.salguero@zoo.ox.ac.uk>

See Also

Examples

matU <- rbind(c(0.1,   0,   0,   0,   0),
              c(0.5, 0.2, 0.1,   0,   0),
              c(  0, 0.3, 0.3, 0.1,   0),
              c(  0,   0, 0.4, 0.4, 0.1),
              c(  0,   0,   0, 0.1, 0.4))

matF <- rbind(c(  0, 1.1,   0, 1.6,   0),
              c(  0, 0.8,   0, 0.4,   0),
              c(  0,   0,   0,   0,   0),
              c(  0,   0,   0,   0,   0),
              c(  0,   0,   0,   0,   0))

repro_stages <- c(2, 4)
matrix_stages <- c('prop', 'active', 'active', 'active', 'active')

mpm_rearrange(matU, matF, repro_stages = repro_stages,
              matrix_stages = matrix_stages)

Rage

Life History Metrics from Matrix Population Models

v1.0.0
GPL-3
Authors
Patrick Barks [aut] (<https://orcid.org/0000-0002-5947-8151>), Danny Buss [ctb], Pol Capdevila [aut] (<https://orcid.org/0000-0002-2842-4302>), Hal Caswell [aut] (<https://orcid.org/0000-0003-4394-6894>), Judy P. Che-Castaldo [aut] (<https://orcid.org/0000-0002-9118-9202>), John Jackson [aut] (<https://orcid.org/0000-0002-4563-2840>), Tamora James [aut] (<https://orcid.org/0000-0003-1363-4742>), Owen Jones [aut, cre] (<https://orcid.org/0000-0001-5720-4686>), Sam Levin [aut] (<https://orcid.org/0000-0002-3289-9925>), William K. Petry [aut] (<https://orcid.org/0000-0002-5230-5987>), Roberto Salguero-Gomez [aut] (<https://orcid.org/0000-0002-6085-4433>), Caroline Schuette [ctb] (<https://orcid.org/0000-0002-2063-8736>), Iain Stott [aut] (<https://orcid.org/0000-0003-2724-7436>), Chelsea C. Thomas [aut] (<https://orcid.org/0000-0002-8155-9353>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.