R: Calculates variation in life expectancy in a discretely...
varLifeExpect
R Documentation
Calculates variation in life expectancy in a discretely stochastic environment.
Description
Provided a P matrix, defining survival transitions across size, this function provides a vector with variance in life expectancy in units of the time-step used, for each of the size bins.
Usage
varLifeExpect(IPMmatrix)
Arguments
IPMmatrix
an IPMmatrix object defining survival transitions.
Value
a vector of variance in life expectancies each corresponding to Pmatrix@meshpoints.
Author(s)
C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.
References
Caswell, 2001. Matrix population models: analysis, construction and
interpretation. 2nd ed. Sinauer. p110-132.
Cochran & Ellner. 1995. Simple methods for calculating age-based life history parameters for stage-structured populations. Ecological Monographs 62, p345-364.
Tuljapurkar & Horvitz, 2006. From stage to age in variable environments. Life expectancy and survivorship. Ecology 87, p1497-1509.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(IPMpack)
Loading required package: Matrix
Loading required package: MASS
Loading required package: nlme
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IPMpack/varLifeExpect.Rd_%03d_medium.png", width=480, height=480)
> ### Name: varLifeExpect
> ### Title: Calculates variation in life expectancy in a discretely
> ### stochastic environment.
> ### Aliases: varLifeExpect
>
> ### ** Examples
>
> # With a single continuous (e.g. size) stage
> dff <- generateData()
> Pmatrix <- makeIPMPmatrix(minSize = min(dff$size, na.rm = TRUE),
+ maxSize = max(dff$size, na.rm = TRUE), growObj = makeGrowthObj(dff),
+ survObj = makeSurvObj(dff))
> vle <- varLifeExpect(Pmatrix)
>
> plot(Pmatrix@meshpoints, vle, ylab = "Variation life expectancy",
+ xlab = "Continuous (e.g. size) stage", type = "l", ylim = c(0,max(vle)))
>
>
>
>
>
>
>
> dev.off()
null device
1
>