# 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)))
Run the code above in your browser using DataLab