Learn R Programming

IPMpack (version 1.6)

createMPMPmatrix: Builds a discrete P matrix from the types of data structures used in IPMpack.

Description

A method that uses bins to construct a discrete survival matrix population model of class IPM using the data structures used by IPMpack.

Usage

createMPMPmatrix(dataf, bins, nEnv = 1)

Arguments

dataf
a dataframe with columns `size', `sizeNext' (`size' is size at t, `sizeNext' is size at t+1); facultatively, dataf may include `covariate' and `covariatel' for discrete covariates, indicating values at t, and at t+1, respectively; these must take values o
bins
numeric, limits of the desired discrete (size) classes.
nEnv
currently not used.

Value

  • an object of class IPMmatrix.

Details

The number of individuals moving from one bin to the next in one time step is identified and probabilities entered into a matrix cell. To obtain a classic matrix population model this can be added to values defined by createMPMFmatrix. Note that the assumption that all individuals for whom is.na(sizeNext) died.

References

For information on P matrix: Caswell. 2001. Matrix population models: construction, analysis, and interpretation. 2nd ed. Sinauer. p110-112.

For information on collapsing large matrices: Salguero-Gomez & Plotkin. 2010. Matrix dimensions bias demographic inferences: implications for comparative plant demography. The American Naturalist 176, p710-720.

See Also

createIPMPmatrix, createMPMFmatrix

Examples

Run this code
dff <- generateData()
matrixCuts <- c(1, 4, 10, 15)
Pmatrix <- createMPMPmatrix(dff, bins = matrixCuts)
Pmatrix

Run the code above in your browser using DataLab