- Title, Copyright, and Preface The Basics
- Chapter 1: Introduction to R and lefko3
- Chapter 2: Preliminaries I: Life History Models
- Chapter 3: Preliminaries II: Data Formatting Matrix Models
- Chapter 4: Matrix Models I: Intro to MPMs, and Raw (Empirical) MPMs
- Chapter 5: Matrix Models II: Function-based MPMs
- Chapter 6: Matrix Models III: Age (Leslie), Hybrid Age, and Age-by-stage MPMs
- Chapter 7: Matrix Models IV: Integral Projection Models Projection Analyses
- Chapter 8: Population Projection I: Deterministic Analysis
- Chapter 9: Population Projection II: Temporal Environmental Stochasticity
- Chapter 10: Population Projection III: Projection Simulations Special Analyses
- Chapter 11: Special Analyses I: Life Table Response Experiments (LTRE) Further Issues
- Chapter 12: Further Issues I: Importing Matrices and MPMs
- Chapter 13: Further Issues II: Importing IPMs and Function-based MPMs
- Chapter 14: Further Issues III: Editing Matrices in MPMs
- Chapter 15: Further Issues IV: Quality Control Appendices
- Chapter 16: Appendix I: Full Analysis Code Examples
- References: Literature cited More chapters will be added over time (currently planned chapter topics include transient dynamics, demographic stochasticity, and adaptive dynamics)
- Tutorial on theory, methods, and concepts
- Tutorial example of raw historical and ahistorical MPM analysis using Lathyrus vernus
- Tutorial example of function-based historical and ahistorical MPM analysis using Cypripedium candidum
- Tutorial example of historical and ahistorical IPM analysis using Lathyrus vernus
- Tutorial example of ahistorical age x stage MPM analysis using Lathyrus vernus
- Tutorial example of deterministic and stochastic LTRE analysis, and MPM import, using the Anthyllis vulneraria example published in Davison et al. 2010
- Materials for ESA 2023 workshop on working with large-format MPMs
- Long format tutorial on raw and function-based historical and ahistorical MPMs, using Cypripedium candidum
- Video tutorial: Intro to lefko3 with a short analysis of Cypripedium candidum
- Currently scheduled workshops are within the annual meeting of the Ecological Society of America in 2023.
- Download and install the latest Xcode from the Apple App Store. This is a very large program - over 10GB. It provides the compilers and interfaces that the Mac version of R relies on to compile code.
- Download and install Xcode Command Line Tools. To do so, please open the Mac terminal, and type "xcode-select --install". This may open a diaglog box asking you if you would like to install developer tools. If this happens, then please click "Yes" or "Install".
- Download and install the latest GNU Fortran Compiler, available here. Choose the most appropriate build given your architecture (pay special attention to the OS version, and to the type of microprocessor).
- Open the Mac terminal back up, and type "export PATH=$PATH:/usr/local/gfortran/bin". This command adds GNU Fortran to the command path, thus allowing R to use it.
- Congrats! You should now be able to install from source!
- Download and install Rtools.
- Add Rtools to the command path. See the section on this in the Rtools download page.
- Annual Symposium (Online): 31 July and 2 Sept 2021
Two workshops, including a 4 hour intro to lefko3 on 2 Sept and a 4 hour intro to using COMPADRE and COMADRE on 31 July. See this page for further details. - Annual Symposium (Online): 20 November 2020
Speakers: T. Takada, H. Tomimatsu, F. Ishihama, H. Yokomizo, R.P. Shefferson - Annual Symposium and Workshop: 8-9 November 2019
Speakers: H. Iijima, R. Kaneko, K. Morita, R. Oizumi, R.P. Shefferson, Y. Tachiki - Semiannual Workshop: 7-9 June 2019
- Annual Symposium and Workshop: 9-10 November 2018
Speakers: Y. Kawai, R. Shefferson, M. Shimada, T. Takada, M. Umezaki, H. Yokomizo
R Package lefko3
Lefko3 is an R package designed to provide a complete working environment to create and analyze size-classified matrix projection models (MPMs), including Lefkovitch MPMs, integral projection models (IPMs), and age-by-stage MPMs, in both raw and function-based formats. It handles the entire workflow in MPM development, from formatting the demographic dataset, to building the life cycle graph, to parameterizing vital rate models, to contructing the MPM, and finally to analysis. It was originally designed to produce historical and ahsitorical matrix projection models (MPMs), where historical MPMs are large matrices that incorporate 3 consecutive time steps in each matrix. These matrices allow the history of the individual to be more completely modeled within population dynamics models. However, the package now covers all size-classified MPM types.
Package lefko3 works on R 3.6.3 or greater on all systems that support R, including Windows, MacOS, Linux, and Unix.
The project is hosted on R-Forge, with the most recent stable version of lefko3 available for download through CRAN, with documentation available here. The most recent development version is available through R-Forge here. Please also see our paper and cite our paper describing lefko3 in Methods in Ecology and Evolution.
Current stable version: 6.1.0 (Jul 2023). Available on CRAN.
New in this stable version: Function add_stage() now adds stages directly into lefkoMat objects. Function hfv_qc() can now run quality control checks of the Gaussian distribution in datasets with more than 5000 data points. Function supplemental() no longer yields errors for supplements in Leslie MPMs. Eigenvalues of 0 no longer yield errors in function lambda3(). Function historicalize3() now correctly estimates first seen time, last seen time, observed age, and alive status under all circumstances. Further bug fixes.
Current development version: 6.1.0.9001 (Aug 2023). Available on R-Forge.
New in this development version: Updates to sensitivity3() and elasticity3() preventing crashes associated with sparse matrix format, and standardizing options across functions.
Next stable version: 6.2.0 (Oct 2023).
Planned for next stable version: Tests of reducibility and ergodicity. Complex IPMs with non-standard size functions. Demetrius entropy and Keyfitz entropy estimation.
On the drawing board: Individual resampling functions. Fast linear model search function. Bootstrapping functions for vertical datasets. Adaptive dynamics projection and pairwise invasion analysis.
lefko3: a gentle introduction: a free online book teaching the use of lefko3. The official html version is available through Bookdown on R Studio Connect, at this site. A full PDF version is also available. We also offer chapters individually in PDF format here:
Tutorial materials already packaged with lefko3:
Other tutorial materials:
Current workshop schedule:
Please contact the lab for further details about workshops.
Installation notes: Package lefko3 is available in its stable format on CRAN and can be downloaded with all relevant binaries from there. However, some users may occasionally wish to download and install the package from source. For example, Mac users wishing to install the development version from R Forge will need to be able to install from source. Package lefko3 is unlike the typical R package in that it relies on core kernels written in C++ to power its functions. This means that installation from source generally requires the installation of some development tools in order for R to install from source properly. If you are a Linux user, then your version of R is already set up to install lefko3 from source. However, if you are a Mac or Windows user, then you will need to complete a few extra steps to install lefko3 successfully from source.
Users may occasionally have issues with R not automatically installing the required packages for lefko3 to function properly when installed. Please make sure to install the following packages manually, in that circumstance (install in the following order): Rcpp, RcppArmadillo, BH, Matrix, TMB, lme4, pscl, VGAM, glmmTMB, Rcompadre, popbio. We also recommend the packages pryr and BAMMtools, for use with our user manual lefko3: a gentle introduction.
Mac users: To set up your Mac to install lefko3 from source, please follow these steps:
Windows users: To set up your PC to install lefko3 from source, please follow these steps:
Power Demography
Power Demography is a semiannual event incorporating workshops aimed at showcasing the cutting edge in demography, and at training the next generation of demographers. Meetings occur in May/June and November. All Power Demography events include workshops taught by leaders in the field, and the series is capped off in November with a symposium disseminating the best current research. Events are held at the University of Tokyo's Komaba Campus, and participants are asked to register.