Learn R Programming

IPMpack (version 2.1)

sampleSequentialIPMs: Makes a list of IPMs where there is a discrete covariate.

Description

Wrapper function to build the IPM corresponding to every level of the discrete covariate, and return a list of these.

Usage

sampleSequentialIPMs(dataf, nBigMatrix = 10, minSize = -2, maxSize = 10, integrateType = "midpoint", correction = "none", explSurv = surv ~ size + size2 + covariate, explGrow = sizeNext ~ size + size2 + covariate, regType = "constantVar", explFec = fec ~size, Family="gaussian", Transform = "none", fecConstants = data.frame(NA))

Arguments

dataf
a dataframe with columns `size', `sizeNext', 'surv', 'fec', 'covariate', 'covariatel'; and 'age' indicating which individuals are seedlings for identifying the mean and variance in seedling size.
nBigMatrix
number of bins in size.
minSize
minimum size.
maxSize
maximum size.
integrateType
integration type.
correction
correction for unintentional eviction (individuals move outside the size range of the IPM). This correction redistributes individuals so that column sums of the IPM match expected survival for that column.
explSurv
Formula and explanatory variables used in the survival model.
explGrow
explanatory variables used in the growth model.
regType
Formula and regression Type for growth (normal density function, truncated, etc).
explFec
explanatory variables used in the fecundity.
Family
a character vector containing the names of the families to be used for the glms, e.g., binomial, poisson, etc. Again, these must appear in the order defined by the list of formula
Transform
a character vector containing the names of the transforms to be used for the response variables, e.g., log, sqrt, -1, etc. Again, these must appear in the order defined by the list of formula
fecConstants
data.frame of constant multipliers for the fecundity model.

Value

list of matrices corresponding to covariates, in order.

Examples

Run this code
dff <- generateData()
IPMlist <- sampleSequentialIPMs(dff, Transform="log")

Run the code above in your browser using DataLab