Learn R Programming

facilitation (version 0.5.2)

mat.model: matrix population model

Description

Produces the Matrix Population Model matrix for a continuous time structured population model, to be applied in a linear ODE. If there is more than one population, returns a list of matrices, or one block-diagonal matrix created by the combination.

Usage

mat.model(data, ns, combine.matrices = FALSE)

Arguments

data

Either the result of a simulation, to extract the parameters from, or a data.frame containing the parameters.

ns

an array of numbers of stages. Use when data is a data.frame and the is more than one population.

combine.matrices

Logical. Combine the matrices into a single, multi-population matrix?

Examples

Run this code
# NOT RUN {
# example 1
mat.model(create.parameters(n=4))

# example 2 
data(malthusian)
mat.model(malthusian)

# example 3
data(twospecies)
mat.model(twospecies,combine.matrices=TRUE)
# }

Run the code above in your browser using DataLab