Learn R Programming

IPMpack (version 1.6)

runSimpleModel: Runs a simple model using default survival and growth functions.

Description

Takes a dataframe, a chosen size, a minimum and maximum size onto which integrate, and a number of bins, and creates a P matrix and plots passage time and life expectancy (does not include fecundity).

Usage

runSimpleModel(dataf, chosenSize, minSize = c(), maxSize = c(), 
nBigMatrix = 500, do.plot = TRUE, is.log = TRUE,  
integrateType = "midpoint", correction="none")

Arguments

dataf
a dataframe with columns size, sizeNext (which is continuous stage in the next time step), and surv, at a minimum.
chosenSize
the target size for which passage time estimates are desired.
minSize
minimum size for the IPM, defaults to a vector of length zero, in which case, it is estimated as either 0.5*min(dataf$size,na.rm = TRUE) if the minimum size is positive, or 1.5*min(dataf$size, na.rm = TRUE) if the minimum size is negative (e.g., reflectin
maxSize
minimum size for the IPM, defaults to a vector of length zero, in which case, it is estimated as 1.5*max(dataf$size, na.rm = TRUE).
nBigMatrix
number of bins used in the IPM.
do.plot
boolean describing whether plots should be produced.
is.log
boolean describing whether continuous stage is on a log scale or not (for plotting).
integrateType
integration type, defaults to "midpoint" (which uses probability density function); other option is "cumul" (which uses the cumulative density function).
correction
correction type, defaults to "none"; option is "constant" which will multiply every column of the IPM by a constant sufficient to adjust values to those predicted for survival at that stage.

Value

  • pTimepassage time to chosenSize from every size in the chosen discrete time step interval; estimation for sizes larger than the chosenSize should be discarded.
  • LElife expectancy in the chosen discrete time step interval.
  • PmatrixThe basic P matrix.
  • growObjThe fitted growth object.
  • survObjThe fitted survival object.

Examples

Run this code
#dff <- generateData()
#a1<-runSimpleModel(dataf=dff, chosenSize=3,do.plot=TRUE)
#names(a1)

Run the code above in your browser using DataLab