sf_create  R Documentation 
Function sf_create()
returns a data frame describing each ahistorical
life history stage in the life history model. This data frame can be used as
input into MPM creation functions including flefko3()
,
flefko2()
, aflefko2()
, rlefko3()
,
rlefko2()
, and arlefko2()
, in which it
determines how each stage is treated during matrix estimation.
sf_create(
sizes,
stagenames = NULL,
sizesb = NULL,
sizesc = NULL,
repstatus = NULL,
obsstatus = NULL,
propstatus = NULL,
matstatus = NULL,
immstatus = NULL,
minage = NULL,
maxage = NULL,
indataset = NULL,
sizemin = NULL,
sizebmin = NULL,
sizecmin = NULL,
sizemax = NULL,
sizebmax = NULL,
sizecmax = NULL,
binhalfwidth = NULL,
binhalfwidthb = NULL,
binhalfwidthc = NULL,
group = NULL,
comments = NULL,
roundsize = 5L,
roundsizeb = 5L,
roundsizec = 5L,
ipmbins = 100L,
ipmbinsb = NA_integer_,
ipmbinsc = NA_integer_
)
sizes 
A numeric vector of the typical or representative size of each
life history stage. If making functionbased MPMs, then this may be a
vector composed of the midpoints of each size bin, or simply of sizes
characteristic of the size bins. If denoting the boundary of an automated
size classification group, then should denote the absolute minimum size of
that group, or the absolute size of that group (see 
stagenames 
A vector of stage names, in the same order as elements in
sizes. Can also be set to 
sizesb 
An optional numeric vector for a second size metric for each
life history stage. Only to be used if stages are defined by at least two
size metrics in all cases. Same issues apply as in 
sizesc 
An optional numeric vector for a third size metric for each
life history stage. Only to be used if stages are defined by at least three
size metrics in all cases. Same issues apply as in 
repstatus 
A vector denoting the binomial reproductive status of each
life history stage. Defaults to 
obsstatus 
A vector denoting the binomial observation status of each
life history stage. Defaults to 
propstatus 
A vector denoting whether each life history stage is a
propagule. Such stages are generally only used in fecundity estimation.
Defaults to 
matstatus 
A vector denoting whether each stage is mature. Must be
composed of binomial values if given. Defaults to 1 for all stages defined
in 
immstatus 
A vector denoting whether each stage is immature. Must be
composed of binomial values if given. Defaults to the complement of vector

minage 
An optional vector denoting the minimum age at which a stage
can occur. Only used in age x stage matrix development. Defaults to

maxage 
An optional vector denoting the maximum age at which a stage
should occur. Only used in age x stage matrix development. Defaults to

indataset 
A vector designating which stages are found within the
dataset. While 
sizemin 
A vector giving the absolute minimum values corresponding to
each size in the 
sizebmin 
A vector giving the absolute minimum values corresponding to
each size in the 
sizecmin 
A vector giving the absolute minimum values corresponding to
each size in the 
sizemax 
A vector giving the absolute maximum values corresponding to
each size in the 
sizebmax 
A vector giving the absolute maximum values corresponding to
each size in the 
sizecmax 
A vector giving the absolute maximum values corresponding to
each size in the 
binhalfwidth 
A numeric vector giving the halfwidth of size bins.
Required if 
binhalfwidthb 
A numeric vector giving the halfwidth of size bins
used for the optional second size metric. Required if 
binhalfwidthc 
A numeric vector giving the halfwidth of size bins
used for the optional third size metric. Required if 
group 
An integer vector providing information on each respective
stage's size classification group. If used, then functionbased MPM creation
functions 
comments 
An optional vector of text entries holding useful text descriptions of all stages. 
roundsize 
This parameter sets the precision of size classification,
and equals the number of digits used in rounding sizes. Defaults to

roundsizeb 
This parameter sets the precision of size classification
in the optional second size metric, and equals the number of digits used in
rounding sizes. Defaults to 
roundsizec 
This parameter sets the precision of size classification
in the optional third size metric, and equals the number of digits used in
rounding sizes. Defaults to 
ipmbins 
An integer giving the number of size bins to create using the
primary size classification variable. This number is in addition to any
stages that are not size classified. Defaults to 
ipmbinsb 
An optional integer giving the number of size bins to create
using the secondary size classification variable. This number is in addition
to any stages that are not size classified, as well as in addition to any
automated size classification using the primary and tertiary size variables.
Defaults to 
ipmbinsc 
An optional integer giving the number of size bins to create
using the tertiary size classification variable. This number is in addition
to any stages that are not size classified, as well as in addition to any
automated size classification using the primary and secondary size
variables. Defaults to 
A data frame of class stageframe
, which includes information
on the stage name, size, reproductive status, observation status, propagule
status, immaturity status, maturity status, presence within the core dataset,
stage group classification, raw bin halfwidth, and the minimum,
center, and maximum of each size bin, as well as its width. If minimum and
maximum ages were specified, then these are also included. Also includes an
empty string variable that can be used to describe stages meaningfully. This
object can be used as the stageframe
input for flefko3()
flefko2()
, rlefko3()
, and rlefko2()
.
Variables in this data frame include the following:
stage 
The unique names of the stages to be analyzed. 
size 
The typical or representative size at which each stage occurs. 
size_b 
Size at which each stage occurs in terms of a second size variable, if one exists. 
size_c 
Size at which each stage occurs in terms of a third size variable, if one exists. 
min_age 
The minimum age at which the stage may occur. 
max_age 
The maximum age at which the stage may occur. 
repstatus 
A binomial variable showing whether each stage is reproductive. 
obsstatus 
A binomial variable showing whether each stage is observable. 
propstatus 
A binomial variable showing whether each stage is a propagule. 
immstatus 
A binomial variable showing whether each stage can occur as immature. 
matstatus 
A binomial variable showing whether each stage occurs in maturity. 
indataset 
A binomial variable describing whether each stage occurs in the input dataset. 
binhalfwidth_raw 
The halfwidth of the size bin, as input. 
sizebin_min 
The minimum size at which the stage may occur. 
sizebin_max 
The maximum size at which the stage may occur. 
sizebin_center 
The midpoint of the size bin at which the stage may occur. 
sizebin_width 
The width of the size bin corresponding to the stage. 
binhalfwidthb_raw 
The halfwidth of the size bin of a second size variable, as input. 
sizebinb_min 
The minimum size at which the stage may occur. 
sizebinb_max 
The maximum size at which the stage may occur. 
sizebinb_center 
The midpoint of the size bin at which the stage may occur, in terms of a second size variable. 
sizebinb_width 
The width of the size bin corresponding to the stage, in terms of a second size variable. 
binhalfwidthc_raw 
The halfwidth of the size bin of a third size variable, as input. 
sizebinc_min 
The minimum size at which the stage may occur, in terms of a third size variable. 
sizebinc_max 
The maximum size at which the stage may occur, in terms of a third size variable. 
sizebinc_center 
The midpoint of the size bin at which the stage may occur, in terms of a third size variable. 
sizebinc_width 
The width of the size bin corresponding to the stage, in terms of a third size variable. 
group 
An integer denoting the size classification group that the stage falls within. 
comments 
A text field for stage descriptions. 
Vectors used to create a stageframe may not mix NA
values with
nonNA
values.
If an IPM or functionbased matrix with automated size classification is
desired, then two stages that occur within the dataset and represent the
lower and upper size limits of the IPM must be marked with ipm
in
the stagenames vector. These stages should have all characteristics other
than size equal, and the size input for whichever size will be classified
automatically must include the minimum in one stage and the maximum in the
other. The actual characteristics of the first stage encountered in the
inputs will be used as the template for the creation of these sizes. Note
that ipm
refers to size classification with the primary size
variable. To automate size classification with the secondary size variable,
use ipmb
, and to automate size classification with the tertiary size
variable, use ipmc
. To nest automated size classifications, use
ipmab
for the primary and secondary size variables, ipmac
for
the primary and tertiary size variables, ipmbc
for the secondary and
tertiary size variables, and ipmabc
for all three size variables.
The primary size variable can also be set with ipma
.
If two or more groups of stages, each with its own characteristics, are to be developed for an IPM or functionbased MPM, then an even number of stages with two stages marking the minimum and maximum size of each group should be marked with the same code as given above, with all other characteristics equal within each group.
Stage classification groups set with the group
variable create zones
within functionbased matrices in which survival transitions are estimated.
These groups should not be set if transitions are possible between all
stages regardless of group. To denote specific transitions as estimable
between stage groups, use the supplemental()
function.
If importing an IPM rather than building one with lefko3
: Using the
vrm_input
approach to building functionbased MPMs with provided
linear model slope coefficients requires careful attention to the
stageframe. Although no hfv data frame needs to be entered in this instance,
stages for which vital rates are to be estimated via linear models
parameterized with coefficients provided via function
vrm_import()
should be marked as occurring within the dataset.
Stages for which the provided coefficients should not be used should be
marked as not occurring within the dataset.
# Lathyrus example
data(lathyrus)
sizevector < c(0, 100, 13, 127, 3730, 3800, 0)
stagevector < c("Sd", "Sdl", "VSm", "Sm", "VLa", "Flo", "Dorm")
repvector < c(0, 0, 0, 0, 0, 1, 0)
obsvector < c(0, 1, 1, 1, 1, 1, 0)
matvector < c(0, 0, 1, 1, 1, 1, 1)
immvector < c(1, 1, 0, 0, 0, 0, 0)
propvector < c(1, 0, 0, 0, 0, 0, 0)
indataset < c(0, 1, 1, 1, 1, 1, 1)
binvec < c(0, 100, 11, 103, 3500, 3800, 0.5)
lathframe < sf_create(sizes = sizevector, stagenames = stagevector,
repstatus = repvector, obsstatus = obsvector, matstatus = matvector,
immstatus = immvector, indataset = indataset, binhalfwidth = binvec,
propstatus = propvector)
# Cypripedium example
data(cypdata)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.