Function trait_axis() provides all necessary data for invasion
analysis. It lists the specific variations to MPMs for each variant run.
Variants can be given via overwritten matrix elements, proxy matrix
elements, additive offsets on matrix elements, matrix element multipliers,
additive offsets to y-intercepts in vital rate models, or specific values
of individual covariates to vary by matrix.
trait_axis(
historical = NULL,
stagebased = NULL,
agebased = NULL,
stageframe = NULL,
stage3 = NULL,
stage2 = NULL,
stage1 = NULL,
age3 = NULL,
age2 = NULL,
eststage3 = NULL,
eststage2 = NULL,
eststage1 = NULL,
estage3 = NULL,
estage2 = NULL,
givenrate = NULL,
offset = NULL,
multiplier = NULL,
type = NULL,
type_t12 = NULL,
surv_dev = NULL,
obs_dev = NULL,
size_dev = NULL,
sizeb_dev = NULL,
sizec_dev = NULL,
repst_dev = NULL,
fec_dev = NULL,
jsurv_dev = NULL,
jobs_dev = NULL,
jsize_dev = NULL,
jsizeb_dev = NULL,
jsizec_dev = NULL,
jrepst_dev = NULL,
jmatst_dev = NULL,
indcova = NULL,
indcovb = NULL,
indcovc = NULL
)A data frame of class adaptAxis. This object can be used as
input in function invade3().
Variables in this object include the following:
Denotes each variant in order, with each row corresponding to a novel variant.
Stage at occasion t+1 in the transition to be replaced.
Stage at occasion t in the transition to be replaced.
Stage at occasion t-1 in the transition to be replaced.
Age at occasion t+1 in the transition to be replaced.
Age at occasion t in the transition to be replaced.
Stage at occasion t+1 in the transition to replace
the transition designated by stage3, stage2, and
stage1.
Stage at occasion t in the transition to replace the
transition designated by stage3, stage2, and stage1.
Stage at occasion t-1 in the transition to replace
the transition designated by stage3, stage2, and
stage1.
Age at occasion t+1 in the transition to replace the
transition designated by age3.
Age at occasion t in the transition to replace the
transition designated by age2.
A constant to be used as the value of the transition.
A constant value to be added to the transition or proxy transition.
A multiplier for proxy transitions or for fecundity.
Designates whether the transition from occasion t to occasion t+1 is a survival transition probability (1), a fecundity rate (2), or a fecundity multiplier (3).
Designates whether the transition from occasion t-1 to occasion t is a survival transition probability (1), a fecundity rate (2).
Numeric deviations to the y-intercept of the vital rate model of survival.
Numeric deviations to the y-intercept of the vital rate model of observation.
Numeric deviations to the y-intercept of the vital rate model of primary size.
Numeric deviations to the y-intercept of the vital rate model of secondary size.
Numeric deviations to the y-intercept of the vital rate model of tertiary size.
Numeric deviations to the y-intercept of the vital rate model of reproduction.
Numeric deviations to the y-intercept of the vital rate model of fecundity.
Numeric deviations to the y-intercept of the vital rate model of juvenile survival.
Numeric deviations to the y-intercept of the vital rate model of juvenile observation.
Numeric deviations to the y-intercept of the vital rate model of juvenile primary size.
Numeric deviations to the y-intercept of the vital rate model of juvenile secondary size.
Numeric deviations to the y-intercept of the vital rate model of juvenile tertiary size.
Numeric deviations to the y-intercept of the vital rate model of juvenile reproduction.
Numeric deviations to the y-intercept of the vital rate model of juvenile maturity.
Numeric values of individual covariate a used in creating new variants.
Numeric values of individual covariate b used in creating new variants.
Numeric values of individual covariate c used in creating new variants.
A single logical value indicating whether the MPMs
intended will be historical or ahistorical. Defaults to TRUE.
A single logical value indicating whether the MPM will be
stage-based or age-by-stage. Defaults to TRUE.
A single logical value indicating whether the MPM will be
age-based or age-by-stage. Defaults to FALSE.
The stageframe used to produce the MPM. Required if producing any stage-based or age-by-stage MPM. Must be omitted for purely age-based MPMs.
String vector of stage names in occasion t+1 in the
transition to be affected. Abbreviations for groups of stages are also
usable (see Notes). Required in all stage-based and age-by-stage
MPMs.
String vector of stage names in occasion t in the
transition to be affected. Abbreviations for groups of stages are also
usable (see Notes). Required in all stage-based and age-by-stage
MPMs.
String vector of stage names in occasion t-1 in the
transition to be affected. Only needed if a historical matrix is to be
produced. Abbreviations for groups of stages are also usable (see
Notes). Required for historical stage-based MPMs.
An integer vector of the ages in occasion t+1 to use in transitions to be affected. Required for all age- and age-by-stage MPMs.
An integer vector of the ages in occasion t to use in transitions to be affected. Required for all age- and age-by-stage MPMs.
String vector of stage names to replace stage3 in a
proxy transition. Only needed if a transition will be replaced by another
estimated transition, and only in stage-based and age-by-stage MPMs.
String vector of stage names to replace stage2 in a
proxy transition. Only needed if a transition will be replaced by another
estimated transition, and only in stage-based and age-by-stage MPMs.
String vector of stage names to replace stage1 in a
proxy historical transition. Only needed if a transition will be replaced by
another estimated transition, and the matrix to be estimated is historical
and stage-based. Stage NotAlive is also possible for raw hMPMs as a
means of handling the prior stage for individuals entering the population in
occasion t.
Integer vector of age at time t+1 to replace
age3 in a proxy transition. Only needed if a transition will be
replaced by another estimated transition, and only in age-based and
age-by-stage MPMs.
Integer vector of age at time t to replace age2
in a proxy transition. Only needed if a transition will be replaced by
another estimated transition, and only in age-based and age-by-stage MPMs.
A numeric vector of fixed rates or probabilities to replace
for the transition described by stage3, stage2, stage1,
and/or age2.
A numeric vector of fixed numeric values to add to the
transitions described by stage3, stage2, stage1, and/or
age2.
A numeric vector of multipliers for the transition
described by stage3, stage2, stage1, and/or
age2, or for the proxy transitions described by eststage3,
eststage2, eststage1, and/or estage2. Defaults to
1.
Integer vector denoting the kind of transition between occasions
t and t+1 to be replaced. This should be entered as 1,
S, or s for the replacement of a survival transition;
2, F, or f for the replacement of a fecundity
transition; or 3, R, or r for a fecundity set value /
general multiplier. If empty or not provided, then defaults to 1 for
survival transition.
An optional integer vector denoting the kind of transition
between occasions t-1 and t. Only necessary if a historical
MPM in deVries format is desired. This should be entered as 1,
S, or s for a survival transition; or 2, F, or
f for a fecundity transitions. Defaults to 1 for survival
transition, with impacts only on the construction of deVries-format hMPMs.
An optional vector of numeric deviations to the y-intercept
of the survival model used in function-based MPM creation. Defaults to
NA for all values.
An optional vector of numeric deviations to the y-intercept
of the observation model used in function-based MPM creation. Defaults to
NA for all values.
An optional vector of numeric deviations to the y-intercept
of the primary size model used in function-based MPM creation. Defaults to
NA for all values.
An optional vector of numeric deviations to the y-intercept
of the secondary size model used in function-based MPM creation. Defaults to
NA for all values.
An optional vector of numeric deviations to the y-intercept
of the tertiary size model used in function-based MPM creation. Defaults to
NA for all values.
An optional vector of numeric deviations to the y-intercept
of the reproduction model used in function-based MPM creation. Defaults to
NA for all values.
An optional vector of numeric deviations to the y-intercept
of the fecundity model used in function-based MPM creation. Defaults to
NA for all values.
An optional vector of numeric deviations to the y-intercept
of the juvenile survival model used in function-based MPM creation. Defaults
to NA for all values.
An optional vector of numeric deviations to the y-intercept
of the juvenile observation model used in function-based MPM creation.
Defaults to NA for all values.
An optional vector of numeric deviations to the y-intercept
of the juvenile primary size model used in function-based MPM creation.
Defaults to NA for all values.
An optional vector of numeric deviations to the y-intercept
of the juvenile secondary size model used in function-based MPM creation.
Defaults to NA for all values.
An optional vector of numeric deviations to the y-intercept
of the juvenile tertiary size model used in function-based MPM creation.
Defaults to NA for all values.
An optional vector of numeric deviations to the y-intercept
of the juvenile reproduction model used in function-based MPM creation.
Defaults to NA for all values.
An optional vector of numeric deviations to the y-intercept
of the juvenile maturity model used in function-based MPM creation.
Defaults to NA for all values.
An optional vector of numeric values for a quantitative
individual covariate used in MPM creation. Should be identified as
individual covariate a in any other modeling. Defaults to NA for all
values.
An optional vector of numeric values for a quantitative
individual covariate used in MPM creation. Should be identified as
individual covariate b in any other modeling. Defaults to NA for all
values.
An optional vector of numeric values for a quantitative
individual covariate used in MPM creation. Should be identified as
individual covariate c in any other modeling. Defaults to NA for all
values.
Negative values are not allowed in givenrate and multiplier
input, but are allowed in offset, if values are to be subtracted from
specific estimated transitions. Stage entries should not be used for purely
age-based MPMs, and age entries should not be used for purely stage-based
MPMs.
Entries in stage3, stage2, and stage1 can include
abbreviations for groups of stages. Use rep if all reproductive
stages are to be used, nrep if all mature but non-reproductive stages
are to be used, mat if all mature stages are to be used, immat
if all immature stages are to be used, prop if all propagule stages
are to be used, npr if all non-propagule stages are to be used,
obs if all observable stages are to be used, nobs if all
unobservable stages are to be used, and leave empty or use all if all
stages in stageframe are to be used. Also use groupX to denote all
stages in group X (e.g. group1 will use all stages in the respective
stageframe's group 1).
Type 3 conversions are referred to as fecundity set values, or general
fecundity multipliers. These set the transitions to be used as fecundity
transitions. Transitions set here will be interpreted as being generally
reproductive, meaning that the from and to stages will be used to determine
the general fecundity transitions to incorporate into stage-based MPMs,
while the age portion of the input will be used to incorporate the actual
multiplier(s) specified. If only stage transitions at certain ages are
expected to be the sole contributors to fecundity, then type 2 conversions
should also be included in the supplement (Type 1 and 2 conversions can be
purely age-specific, and do not set reproductive transitions in MPM
creation). For example, if all stage 2 to stage 3 transitions above age 2
yield fecundity, then stage 2 to stage 3 can be set to
multiplier = 1.0 with convtype = 3, and the same transition
for age2 = c(1, 2) can be set to multiplier = c(0, 0).
Several operations may be included per transition. Operations on the same row of the resulting data frame are generally handled with given rate substitutions first, then with proxy transitions, then by additive offsets, and finally by multipliers. This order can be manipulated by ordering operations across rows, with higher numbered rows in the data frame being performed later.
ta_skeleton()
library(lefko3)
data(cypa_data)
sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5)
stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg",
"XLg")
repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1)
obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1)
matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1)
immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0)
propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1)
binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7)
cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector,
repstatus = repvector, obsstatus = obsvector, matstatus = matvector,
propstatus = propvector, immstatus = immvector, indataset = indataset,
binhalfwidth = binvec)
cypraw_v1 <- verticalize3(data = cypa_data, noyears = 18, firstyear = 1994,
individcol = "plant_id", blocksize = 2, sizeacol = "Inf.94",
sizebcol = "Veg.94", repstracol = "Inf.94", fecacol = "Inf.94",
stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE,
NRasRep = TRUE)
cypa_ta <- trait_axis(stageframe = cypframe_raw,
stage3 = c("P1", "P1", "P1", NA, NA, NA),
stage2 = c("rep", "rep", "rep", NA, NA, NA),
multiplier = c(0.5, 2.0, 10., NA, NA, NA), type = c(2, 2, 2, NA, NA, NA),
obs_dev = c(NA, NA, NA, 0.5, 2.0, 50), fec_dev = c(NA, NA, NA, -1000, 0, 1000))
Run the code above in your browser using DataLab