Description Usage Arguments Value Examples
This is designed to make it easy to collapse simulation output from an age-structured model into stages for ease in plotting. It works well with the output provided by pop.projection in the popbio package.
1 | collapse_stage.vector(stage.vectors, stages = NULL)
|
stage.vectors |
A matrix, with each row being a class in the MPM and each column being a time step. The stage.vectors element of pop.projection satisfies this. |
stages |
An optional vector, specifying the stage associated with each class of the MPM. Should
be the same length as the number of rows of stage.vectors. If the matrix was produced using a Leslie matrix created using
|
A matrix similar to the input stage.vectors, but with the rows collapsed into the reduced number of stages.
1 2 3 4 5 6 7 | # Leslie matrix version of the same data of the loggerhead population
A2 <- make_stage4age_matrix(loggerhead[[2]])
N0 <- rep(10, nrow(A2))
library(popbio)
pop.sim <- pop.projection(A2, N0)
sv <- collapse_stage.vector(pop.sim$stage.vector)
stage.vector.plot(sv)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.