plant
A package for modeling forest trait ecology and evolution.
https://github.com/traitecoevo/plant
Category: Biosphere
Sub Category: Plants and Vegetation
Keywords
c-plus-plus demography dynamic ecology evolution forests plant-physiology r science-research simulation trait
Keywords from Contributors
geo
Last synced: about 7 hours ago
JSON representation
Repository metadata
Trait-Driven Models of Ecology and Evolution :evergreen_tree:
- Host: GitHub
- URL: https://github.com/traitecoevo/plant
- Owner: traitecoevo
- License: agpl-3.0
- Created: 2013-04-16T00:30:53.000Z (over 13 years ago)
- Default Branch: develop
- Last Pushed: 2026-08-05T07:09:12.000Z (10 days ago)
- Last Synced: 2026-08-10T16:21:56.881Z (4 days ago)
- Topics: c-plus-plus, demography, dynamic, ecology, evolution, forests, plant-physiology, r, science-research, simulation, trait
- Language: C++
- Homepage: https://traitecoevo.github.io/plant
- Size: 26.4 MB
- Stars: 55
- Watchers: 9
- Forks: 20
- Open Issues: 83
- Releases: 7
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE.md
- Agents: agents.md
- Cla: CLA.md
README.md
plant: A package for modelling forest trait ecology and evolution
The plant package for R is an extensible framework for modelling size- and trait-structured demography, ecology and evolution in simulated forests. At its core, plant is an individual-based model where plant physiology and demography are mediated by traits. Individual plants from multiple species can be grown in isolation, in patches of competing plants or in metapopulations under a disturbance regime. These dynamics can be integrated into metapopulation-level estimates of invasion fitness and vegetation structure. Accessed from R, the core routines in plant are written in C++. The package provides for alternative physiology models and for capturing trade-offs among parameters. A detailed test suite is provided to ensure correct behaviour of the code.
Development status. Active development happens on the
developbranch, which is currently well ahead of the most recent tagged release. Notably,developincludes a new physiological model, TF24, which we plan to document and ship in an upcoming release. If you want the latest features (including TF24), install fromdevelop(see Installation); for a stable, citable version, install a tagged release.Current development is tracked on our project board and in the issue tracker — that's the best place to see what's planned, report bugs, or pick up something to contribute.
The plant model family
The plant model is developed across three companion repositories, with work
coordinated on a shared project board
("Plant model development"):
| Repository | Role |
|---|---|
| plant | Core C++/R model: size- and trait-structured demography, the SCM solver, and the physiological strategies (FF16, TF24, …). |
| regnans | Evolutionary community assembly on top of plant — invasion fitness, demographic equilibria, and selection gradients. |
| overstorey | The narrative documentation / field guide site (user guides, theory, worked reproductions). |
Issues from all three repositories feed into the
project board, which is the
single place to see what is planned, in progress, or done across the family.
Citation
Falster DS, FitzJohn RG, Brännström Å, Dieckmann U, Westoby M (2016) plant: A package for modelling forest trait ecology & evolution. Methods in Ecology and Evolution 7: 136-146. doi: 10.1111/2041-210X.12525
Documentation
An overview of the plant package is given by the above publication. Further background on the default FF16 growth model is available in Falster et al 2011 (10.1111/j.1365-2745.2010.01735.x) and Falster et al 2017 (10.1101/083451).
The narrative documentation — user guides, theory, and worked examples — now lives at Overstorey, a dedicated field guide to the plant model (source). The package's own pkgdown site hosts the API/function reference. Initial versions of some of this material were also included as supplementary material with the publication about plant, which can be accessed here.
Package structure
Plant is a complex package, using C++20 behind the scenes for speed with R6 classes (via the Rcpp and RcppR6 packages). In this blog post, Rich FitzJohn and I describe the key technologies used to build the plant package.
If you are interested in developing or extending plant, start with agents.md, which documents the package architecture, the C++/R interface, the build workflow, and how to add a new model. The plant-new-strategy skill (.claude/skills/plant-new-strategy/) walks through scaffolding and implementing a new strategy.
Installation
Requirements
-
You must be using R 4.5.0 or newer. At this stage the package is not on CRAN. Your options for installing are described below.
-
Installation requires a C++20 compatible compiler (recent versions of clang/gcc on macOS and Linux satisfy this). On Windows machines you will need to install Rtools. When I tried this in Rstudio, the program automagically sensed the absence of a compiler and asked if I wanted to install Rtools. Click
Yes!
Option 1, using remotes::install_github
The plant package can be installed direct from github using the remotes package:
remotes::install_github("traitecoevo/plant", dependencies=TRUE)
To install a specific (older) release, decide for the version number that you want to install in https://github.com/traitecoevo/plant/releases e.g.
remotes::install_github("traitecoevo/plant@v1.0.0", dependencies=TRUE)
with "v1.0.0" replaced by the appropriate version number. Note, the latest version of plant resides on the develop branch, which is sporadically released. plant follows semantic versioning meaning that major version indicate a potential break in backward compatibility.
Option 2, building from source
If familiar with git you might find it easiest to build plant directly from the source code. This is most useful if developing new models or strategies, or to contribute new features.
First, clone the plant repository
git clone https://github.com/traitecoevo/plant
Open an R session in the folder, then to install dependencies run
devtools::install_deps()
Then to compile the project
devtools::install()
or
devtools::load_all()
Getting started
The best place to start is Overstorey, which hosts the full narrative documentation and a set of tutorial guides. In particular:
- Get started with plant — an overview of the package and a minimal worked example.
- Individuals, Patch dynamics and Demography — the core simulation workflows.
- Parameters — configuring strategies, traits and control settings.
The package's pkgdown site hosts the function reference.
A minimal example, growing a patch of competing plants with the default FF16 model:
library(plant)
# Set up parameters for the default FF16 model and add a strategy
p <- scm_base_parameters("FF16")
p <- add_strategies(p, trait_matrix(0.0825, "lma"))
# Run the deterministic (method-of-characteristics) solver and collect output
results <- run_scm(p, collect = TRUE)
If you want to develop or extend plant (e.g. add a new strategy/model), see agents.md and the plant-new-strategy skill (.claude/skills/plant-new-strategy/).
Benchmarking
For fair performance comparisons across branches, rebuild compiled code before
running benchmarks:
make
Rscript -e "devtools::load_all(quiet=TRUE); run_plant_benchmarks()"
Running benchmarks without a fresh make can compare stale binaries and give
misleading timing differences.
Reporting issues
Questions, bug reports and feature requests are welcome via the
GitHub issue tracker. New issues are
automatically added to the project board
with status Backlog.
To keep the board sortable, please:
-
Apply one type label — the three repositories share the same set:
bug— an existing feature not functioning as intendedtask— a discrete piece of work needed for a featureepic— a new feature or capability, usually an umbrella over several tasks
-
Prefix the title with a theme tag in square brackets, e.g.
[speed] Cache the light-environment spline. Use an existing theme where it
fits; otherwise[other]:[TF24 hydraulics]·[TF24 allometry]·[TF24 nsc]·[acclimation]·
[simplify interface]·[evol assembly]·[Env drivers]·[speed]·
[patch variations]·[documentation]·[other]
A title may carry more than one tag when it genuinely spans themes
(e.g. [speed] [TF24 hydraulics] …).
Publications using plant
Here are some example publications using plant:
- Falster DS, FitzJohn RG, Brännström Å, Dieckmann U, Westoby M (2016) plant: A package for modelling forest trait ecology & evolution. Methods in Ecology and Evolution 7: 136-146. DOI: 10.1111/2041-210X.12525 code: github
- Falster DS, Duursma RA, FitzJohn RG (2018) How functional traits influence plant growth and shade tolerance across the life cycle. Proceedings of the National Academy of Sciences 115: E6789–E6798. DOI: 10.1073/pnas.1714044115 code: github
- Falster DS, Kunstler GK, FitzJohn RG, Westoby M (2021) Emergent shapes of trait-based competition functions from resource-based models: a Gaussian is not normal in plant communities. The American Naturalist 198: 256–267. DOI: 10.1086/714868 code: github
Contributing
Contributions are welcome. By submitting a pull request or code to this repository, you agree to the terms of the Contributor License Agreement.
Plant family
plant is part of the plant family of packages in the
traitecoevo org, built around the
plant forest model. Docs hub:
https://traitecoevo.github.io/overstorey/.
Contributing: please skim the family
issue guide
before filing — issues across the family are triaged on
board #5, and cross-package context lives in
plant-meta.
Owner metadata
- Name: Trait Ecology and Evolution
- Login: traitecoevo
- Email:
- Kind: organization
- Description:
- Website:
- Location: Australia
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/11747619?v=4
- Repositories: 64
- Last ynced at: 2023-06-03T21:10:14.705Z
- Profile URL: https://github.com/traitecoevo
GitHub Events
Total
- Delete event: 28
- Pull request event: 18
- Issues event: 10
- Watch event: 1
- Issue comment event: 4
- Push event: 134
- Pull request review comment event: 3
- Pull request review event: 6
- Create event: 33
Last Year
- Delete event: 22
- Pull request event: 3
- Issues event: 9
- Watch event: 1
- Issue comment event: 2
- Push event: 102
- Pull request review event: 2
- Create event: 27
Committers metadata
Last synced: 10 days ago
Total Commits: 1,608
Total Committers: 9
Avg Commits per committer: 178.667
Development Distribution Score (DDS): 0.32
Commits in past year: 89
Committers in past year: 3
Avg Commits per committer in past year: 29.667
Development Distribution Score (DDS) in past year: 0.191
| Name | Commits | |
|---|---|---|
| Rich FitzJohn | r****n@g****m | 1093 |
| Daniel Falster | d****r@u****u | 360 |
| Rafael Schouten | r****n@g****m | 57 |
| johnWilshire | j****e@g****m | 34 |
| Andrew O'Reilly-Nugent | a****t@g****m | 31 |
| itowers1 | 3****1 | 18 |
| Mitchell Henry | m****4@g****m | 9 |
| Felix Lawrence | f****e@n****u | 4 |
| Becca-90 | 8****0 | 2 |
Committer domains:
- nicta.com.au: 1
- unsw.edu.au: 1
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 378
Total pull requests: 171
Average time to close issues: about 1 year
Average time to close pull requests: about 1 month
Total issue authors: 14
Total pull request authors: 8
Average comments per issue: 1.96
Average comments per pull request: 2.29
Merged pull request: 128
Bot issues: 0
Bot pull requests: 0
Past year issues: 45
Past year pull requests: 54
Past year average time to close issues: 13 days
Past year average time to close pull requests: 7 days
Past year issue authors: 3
Past year pull request authors: 3
Past year average comments per issue: 1.16
Past year average comments per pull request: 1.33
Past year merged pull request: 40
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- dfalster (161)
- richfitz (134)
- aornugent (34)
- rafaqz (24)
- itowers1 (12)
- foxeswithdata (3)
- kunstler (2)
- Becca-90 (2)
- fjrrobinson (1)
- johnWilshire (1)
- eebutler (1)
- hrlai (1)
- pzylstra (1)
- hol430 (1)
Top Pull Request Authors
- dfalster (92)
- aornugent (42)
- rafaqz (13)
- itowers1 (10)
- devmitch (9)
- Becca-90 (2)
- johnWilshire (2)
- richfitz (1)
Top Issue Labels
- bug (24)
- documentation (22)
- task (19)
- epic (17)
- wontfix (13)
- enhancement (9)
- fixed_on_development (9)
- performance (9)
- testing (8)
- low priority (7)
- easy (5)
- cross-package (5)
- blocked (4)
- ready (3)
- question (3)
- help (1)
- on hold (1)
- duplicate (1)
Top Pull Request Labels
- epic (3)
- blocked (1)
- cross-package (1)
Dependencies
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- R >= 3.3.0 depends
- BB * imports
- R6 * imports
- Rcpp * imports
- crayon * imports
- dplyr * imports
- loggr * imports
- magrittr * imports
- nleqslv * imports
- purrr * imports
- rlang * imports
- tibble * imports
- tidyr * imports
- RcppR6 >= 0.2.3 suggests
- bench * suggests
- deSolve * suggests
- ggplot2 * suggests
- ggridges * suggests
- kableExtra * suggests
- knitr * suggests
- markdown * suggests
- numDeriv * suggests
- parallel * suggests
- patchwork * suggests
- rmarkdown * suggests
- testthat * suggests
- actions/add-to-project v1.0.2 composite
Score: 7.124478262493424