vr_vec | R Documentation |
Derive a vector of stage-specific vital rates of survival, growth, shrinkage, stasis, dormancy, or reproduction from a matrix population model. These functions include optional arguments for excluding certain stage classes from the calculation (see Excluding stages), and defining the set of biologically-possible transitions (see Possible transitions).
This decomposition assume that all transition rates are products of a
stage-specific survival term (column sums of matU
) and a lower level
vital rate that is conditional on survival (growth, shrinkage, stasis,
dormancy, or reproduction). Reproductive vital rates that are not conditional
on survival (i.e., within a stage class from which there is no survival) are
also allowed.
vr_vec_survival(matU, posU = matU > 0, exclude_col = NULL)
vr_vec_growth(
matU,
posU = matU > 0,
exclude = NULL,
exclude_row = NULL,
exclude_col = NULL,
surv_only_na = TRUE
)
vr_vec_shrinkage(
matU,
posU = matU > 0,
exclude = NULL,
exclude_row = NULL,
exclude_col = NULL,
surv_only_na = TRUE
)
vr_vec_stasis(matU, posU = matU > 0, exclude = NULL, surv_only_na = TRUE)
vr_vec_dorm_enter(matU, posU = matU > 0, dorm_stages)
vr_vec_dorm_exit(matU, posU = matU > 0, dorm_stages)
vr_vec_reproduction(
matU,
matR,
posR = matR > 0,
exclude_col = NULL,
weights_row = NULL
)
matU |
The survival component of a matrix population model (i.e., a square projection matrix only containing survival-related transitions; progression, stasis, and retrogression). |
posU |
A logical matrix of the same dimension as |
exclude_col |
Integer, character or logical vector indicating stages for which transitions both to and from the stage should be excluded from the calculation of vital rates. See section Excluding stages. |
exclude |
Integer, character or logical vector indicating stages for which transitions both to and from the stage should be excluded from the calculation of vital rates. See section Excluding stages. |
exclude_row |
Integer, character or logical vector indicating stages for which transitions both to and from the stage should be excluded from the calculation of vital rates. See section Excluding stages. |
surv_only_na |
If there is only one possible |
dorm_stages |
Integer or character vector indicating dormant stage classes. |
matR |
The reproductive component of a matrix population model (i.e., a square projection matrix only reflecting transitions due to reproduction; either sexual, clonal, or both). |
posR |
A logical matrix of the same dimension as |
weights_row |
Vector of stage-specific weights to apply while summing vital rates across rows within columns (e.g., reproductive value vector). |
Vector of vital rates. Vital rates corresponding to impossible
transitions are coerced to NA
(see Possible transitions).
A transition rate of 0
within a matrix population model may indicate
that the transition is not possible in the given life cycle (e.g., tadpoles
never revert to eggs), or that the transition rate is possible but was
estimated to be 0
in the relevant population and time period. If vital
rates are to be averaged across multiple stage classes, or compared across
populations, it may be important to distinguish between these two types of
zeros.
By default, the vitals_
functions assume that a transition rate of
0
indicates an impossible transition, in which case a value of
NA
will be used in relevant calculations. Specifically, the arguments
posU
and posR
are specified by the logical expressions
(matU > 0)
and (matR > 0)
, respectively. If the matrix
population model includes transitions that are estimated to be 0
but
still in fact possible, one should specify the posU
and/or posR
arguments manually.
It may be desirable to exclude one or more stages from the calculation of
certain vital rates. For instance, a user might not believe that 'growth' to
a dormant stage class really reflects biological growth, in which case the
user could exclude transitions to the dormant stage class using the
argument exclude_row
. The user may or may not want to ignore 'growth'
transitions from the dormant stage class, which can be done using
exclude_col
. The argument exclude_col
effectively just coerces
the respective vital rate to NA
, to prevent it from getting used in
subsequent calculations. To exclude transitions both to and from a
given set of stages, use argument exclude
.
Patrick Barks <patrick.barks@gmail.com>
Other vital rates:
vital_rates()
,
vr_mat
,
vr
# create example MPM (stage 4 is dormant)
matU <- rbind(
c(0.1, 0, 0, 0),
c(0.5, 0.2, 0.1, 0.1),
c(0, 0.3, 0.3, 0.1),
c(0, 0, 0.5, 0.4)
)
matR <- rbind(
c(0, 0.7, 1.1, 0),
c(0, 0.3, 0.8, 0),
c(0, 0, 0, 0),
c(0, 0, 0, 0)
)
vr_vec_survival(matU, exclude_col = 4)
vr_vec_growth(matU, exclude = 4)
# `exclude*` and `*_stages` arguments can accept stage names
matU <- name_stages(matU)
matR <- name_stages(matR)
vr_vec_shrinkage(matU, exclude = 4)
vr_vec_stasis(matU, exclude = "stage_4")
vr_vec_dorm_enter(matU, dorm_stages = 4)
vr_vec_dorm_exit(name_stages(matU), dorm_stages = "stage_4")
vr_vec_reproduction(matU, matR, exclude_col = "stage_4")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.