Computation

R package adapt3

Package adapt3 uses the lefko3 programming environment to develop and analyze matrix community models (MCMs), and to run pairwise and multiple invasibility analyses.

Package adapt3 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 CRAN and GitHub. The most stable version of adapt3 is available for download through CRAN, and can be automatically downloaded with the install.packages() function in base R. The most recent development version is available through r-universe here. Documentation is available here.


Current stable version: 2.0.7 (Feb 2026). Available on CRAN.

New in this stable version: Batch projection now available. New density dependence functions available. Trait axis can now be defined with individual covariates Equivalence frames and density frames can be supplied annually for each MPM. Aggregate density is now output by function project3(). Auto-processing of axis labels is now possible for plot.adaptProj(). Unit tests added.

Current development version: 2.0.8.9003 (Feb 2026). Available on r-universe.

New in this development version: Fixed bug causing function-based community projection to fail under certain situations involving supplements. Fixed passing of batch alterations via supplements in function-based uses of function batch_project3(). Fixed small issues with examples and unit tests. Expanded unit tests.

Next stable version: 2.1.0 (late 2026).

On the drawing board: Further functions to help process matrix community models.


R Package lefko3

Package lefko3 is designed to provide a complete working environment to create and analyze matrix projection models (MPMs), including Leslie MPMs, Lefkovitch MPMs, historical stage-classified 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 history model, to parameterizing vital rate models, to contructing the MPM, and finally to projection and analysis.

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 CRAN and GitHub. The most stable version of lefko3 is available for download through CRAN, and can be automatically downloaded with the install.packages() function in base R. The most recent development version is available through r-universe here. Documentation is available here. Please also see our paper and cite our paper describing lefko3 in Methods in Ecology and Evolution.


Current stable version: 6.7.2 (Feb 2026). Available on CRAN.

New in this stable version: Raw MPMs can now be output with NaN values populating matrix elements with no data. Fixed bug involving processing of density_input() frames.

Current development version: 6.7.2.9002 (Feb 2026). Available on r-universe.

New in this development version: Function lambda3() can now assess lambda for U and F matrices via the style argument. Function bootstrap3() can now rename individual identities for bootstrapped datasets. Corrected bug in function stage_weight() leading to incorrect handling of age-by-stage MPMs.

Next stable version: 6.8.0 (late 2026).

On the drawing board: Fast linear model search function. Tests of reducibility and ergodicity. Complex IPMs with non-standard size functions. Demetrius entropy and Keyfitz entropy estimation.

Users of lefko3 may report issues with the package on Github. A Discussion community also exists within the lefko3 Github repository.

lefko3: a gentle introduction: a free online book teaching the use of lefko3. The official html version is available through Posit Connect Cloud, at this site. To go to specific chapter, use the following links:

Tutorial materials already packaged with lefko3:

  1. Tutorial on theory, methods, and concepts
  2. Tutorial example of raw historical and ahistorical MPM analysis using Lathyrus vernus
  3. Tutorial example of function-based historical and ahistorical MPM analysis using Cypripedium candidum
  4. Tutorial example of historical and ahistorical IPM analysis using Lathyrus vernus
  5. Tutorial example of ahistorical age x stage MPM analysis using Lathyrus vernus
  6. Tutorial example of deterministic and stochastic LTRE analysis, and MPM import, using the Anthyllis vulneraria example published in Davison et al. 2010

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. The latest development version, including all binaries, are available on r-universe.

Some users may occasionally wish to download and install the package 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:

  1. 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.
  2. 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".
  3. 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).
  4. 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.
  5. Congrats! You should now be able to install from source!

Windows users: To set up your PC to install lefko3 from source, please follow these steps:

  1. Download and install Rtools.
  2. Add Rtools to the command path. See the section on this in the Rtools download page.


Research

Evolution of mycoheterotrophy

Evolutionary loss of photosynthesis

We are analyzing long-term demographic data and parameterizing evolutionary models to understand why so many plant species have lost photosynthesis and evolved to parasitize mycorrhizal fungi. Our work is both demographic and comparative, invloving matrix projection, adaptive dynamics, and phylogenetic analysis to understand these phenomena.


Individual history

Eco-evolutionary impacts of individual history

The events that occur in an individual's life can affect that individual in the long-term, and this impact can extend to long-term influences on population dynamics. For example, one of the greatest long-term impacts of individual history on mortality in herbaceous plants can come from high growth between years. We are studying the ecological and evolutionary dimensiomns of these impacts, and creating tools to study them.


Evolution of sprouting

Adaptive dynamics of sprouting

Why can so many photosynthetic plants live for years as rootstock with photosynthesizing? We address this question with a variety of evolutionary methods, including reconstructing trait evolution and game theoretical modeling. Our research has been featured in the news media, including on Nexus Media, Science Daily, or the Daily Mail.


Drivers of demography

Drivers of plant demography

Why do plant populations vary in demographic response to climatic variation? How does genetic composition interact with environment to determine population dynamics? We work with herbaceous perennials to answer these questions.


Evolution of senescence

Plant and fungal senescence

We generally believe all organisms will senesce if they live long enough, but empirical assessments and some theory suggest otherwise. What determines how senescence evolves across the Tree of Life?



Education

Power Demography Symposium

We are pleased to announce an upcoming symposium in the Power Demography series focused on Population Management: Theory, Application, and Prediction, to be held at the University of Tokyo's Komaba Campus on 7 Nov 2025.

Population Management Symposium

Power Demography Workshop

We are offering a free three-day workshop focused on Theories of Demography and Structured Populations, to be held at the University of Tokyo's Komaba Camus on 19-21 Nov 2025.

Theories of Demography and Structured Populations