A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

r3PG

An R package for forest growth simulation using the 3-PG process-based model.
https://github.com/trotsiuk/r3pg

Category: Biosphere
Sub Category: Forest Modeling and Analysis

Last synced: about 15 hours ago
JSON representation

Repository metadata

An R package for forest growth simulation using the 3-PG process-based model

README.md

Project Status: Active – The project has reached a stable, usable state and is being actively developed.
R-CMD-check
CRAN_Status_Badge

License: GPL v3

Purpose

r3PG provides an implementation of the Physiological Processes Predicting Growth (3-PG) model (Landsberg & Waring, 1997), which simulate forest growth and productivity. The r3PG serves as a flexible and easy-to-use interface for the 3-PGpjs (Sands, 2010) and the 3-PGmix (Forrester & Tang, 2016) model written in Fortran. The package enables fast and easy interaction with the model, and the Fortran re-implementation facilitates computationally intensive sensitivity analysis and calibration. The user can flexibly switch between various options and submodules, to use the original 3-PGpjs model version for monospecific, even-aged and evergreen forests and the 3-PGmix model, which can also simulate multi-cohort stands (e.g. mixtures, uneven-aged) that contain deciduous species.

Usage

Below is a basic example, for more extended examples please visit package vignette.

The main function is run_3PG() which returns all 108 simulated variables for each species at a monthly time-step, either as a 4-dimentional array or a long format data frame.

library(r3PG)
out_3PG <- run_3PG(
  site        = d_site, 
  species     = d_species, 
  climate     = d_climate, 
  thinning    = d_thinning,
  parameters  = d_parameters, 
  size_dist   = d_sizeDist,
  settings    = list(light_model = 2, transp_model = 2, phys_model = 2, 
                height_model = 1, correct_bias = 0, calculate_d13c = 0),
  check_input = TRUE, df_out = TRUE)

head( out_3PG )

To visualize the output:

library(dplyr)
library(ggplot2)

sel_var <- c('biom_stem', 'biom_foliage', 'biom_root')

out_3PG %>%
  filter( variable %in% sel_var ) %>%
  ggplot( aes(date, value, color = species) ) +
  geom_line() +
  facet_wrap(~variable, scales = 'free') +
  theme_classic()

If you prefer to use data stored in Excell, you can use the following example. Data to reproduce this example are stored in data-raw/internal_data/data.input.xlsx.

library(readxl)

f_loc <- 'data.input.xlsx'

run_3PG(
  site        = read_xlsx(f_loc, 'site'),
  species     = read_xlsx(f_loc, 'species'),
  climate     = read_xlsx(f_loc, 'climate'),
  thinning    = read_xlsx(f_loc, 'thinning'),
  parameters  = read_xlsx(f_loc, 'parameters'), 
  size_dist   = read_xlsx(f_loc, 'sizeDist'),
  settings    = list(light_model = 2, transp_model = 2, phys_model = 2, 
                height_model = 1, correct_bias = 0, calculate_d13c = 0),
  check_input = TRUE, df_out = TRUE)

Installation

Stable release

r3PG is available for instalation from CRAN

install.packages("r3PG")

Development release

To install the current (development) version from the repository, run the following command:

if(!require(devtools)){install.packages(devtools)}
devtools::install_github(repo = "trotsiuk/r3PG", build_vignettes = T)

The unit test status of the master (development) branch is R-CMD-check

Other 3-PG implementations in R

We would like to acknowledge that r3PG is not the only 3-PG implementations in R. We are aware of the following other packages:

Maintainer Source
Daniel M. Griffith https://github.com/griffithdan/r3PG
Georgios Xenakis https://github.com/drGeorgeXenakis/fr3PGD
Francesco Minunno https://github.com/checcomi/threePGN-package
Quinn Thomas https://github.com/EcoDynForecast/DAPPER

We explain in a recent publication (Trotsiuk et al, 2020) how these r3PG packages differs and / or improves over these.

Issues, suggestions, contributions

Please submit issues, bugs and suggestions in the dedicated page. Contribution and improvements are always welcome!

Author and contact

Volodymyr Trotsiuk;
Florian Hartig;
David I. Forrester

Citation

Trotsiuk, V., Hartig, F., Forrester, D.I. (2020). r3PG – an R package for simulating forest growth using the 3-PG process-based model. Methods Ecol. Evol., 11, 1470–1475. https://doi.org/10.1111/2041-210X.13474

References

Forrester, D. I., & Tang, X. (2016). Analysing the spatial and temporal dynamics of species interactions in mixed-species forests and the effects of stand density using the 3-PG model. Ecological Modelling, 319, 233–254. https://doi.org/10.1016/j.ecolmodel.2015.07.010

Landsberg, J. J., & Waring, R. H. (1997). A generalised model of forest productivity using simplified concepts of radiation-use efficiency, carbon balance and partitioning. Forest Ecology and Management, 95(3), 209–228. https://doi.org/10.1016/S0378-1127(97)00026-1

Sands, P. J. (2010). 3PGpjs user manual. Retrieved from https://3pg.sites.olt.ubc.ca/files/2014/04/3PGpjs_UserManual.pdf

Trotsiuk, V., Hartig, F., Cailleret, M., Babst, F., Forrester, D. I., Baltensweiler, A., … Schaub, M. (2020). Assessing the response of forest productivity to climate extremes in Switzerland using model–data fusion. Global Change Biology, 26(4), 2463–2476. https://doi.org/10.1111/gcb.15011

Forrester, D. I., Hobi M. L., Mathys A. S., Stadelmann G., Trotsiuk V. (2021). Calibration of the process-based model 3-PG for major central European tree species. European Journal of Forest Research, 140, 847-868. https://doi.org/10.1007/s10342-021-01370-3


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 7 days ago

Total Commits: 211
Total Committers: 6
Avg Commits per committer: 35.167
Development Distribution Score (DDS): 0.455

Commits in past year: 27
Committers in past year: 2
Avg Commits per committer in past year: 13.5
Development Distribution Score (DDS) in past year: 0.074

Name Email Commits
trotsiuk v****k@g****m 115
Volodymyr Trotsiuk v****k@w****h 54
florianhartig f****g 28
Rasilgon r****n@g****m 11
trotsiuk t****k@r****h 2
trotsiuk t****k@r****l 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 84
Total pull requests: 21
Average time to close issues: 4 months
Average time to close pull requests: about 1 month
Total issue authors: 16
Total pull request authors: 4
Average comments per issue: 4.02
Average comments per pull request: 0.29
Merged pull request: 18
Bot issues: 0
Bot pull requests: 0

Past year issues: 5
Past year pull requests: 0
Past year average time to close issues: about 17 hours
Past year average time to close pull requests: N/A
Past year issue authors: 3
Past year pull request authors: 0
Past year average comments per issue: 0.8
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/trotsiuk/r3pg

Top Issue Authors

  • florianhartig (25)
  • trotsiuk (23)
  • twest820 (9)
  • DavidForrester (6)
  • Rasilgon (6)
  • SebastianBr2 (3)
  • LisaHuelsmann (2)
  • GakenouOF (2)
  • ChaitraliGore (1)
  • Dieguni (1)
  • Catarinaxa (1)
  • Alvertin83 (1)
  • JohannesOberpriller (1)
  • zhengjiji456 (1)
  • jm5233 (1)

Top Pull Request Authors

  • trotsiuk (13)
  • Rasilgon (5)
  • florianhartig (2)
  • JohannesOberpriller (1)

Top Issue Labels

  • enhancement (12)
  • bug (11)
  • question (7)
  • documentation (6)
  • help wanted (2)

Top Pull Request Labels


Package metadata

cran.r-project.org: r3PG

Simulating Forest Growth using the 3-PG Model

  • Homepage: https://github.com/trotsiuk/r3PG
  • Documentation: http://cran.r-project.org/web/packages/r3PG/r3PG.pdf
  • Licenses: GPL-3
  • Latest release: 0.1.6 (published over 1 year ago)
  • Last Synced: 2025-04-26T12:02:53.987Z (1 day ago)
  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 239 Last month
  • Docker Downloads: 7
  • Rankings:
    • Forks count: 5.307%
    • Stargazers count: 11.922%
    • Average: 27.099%
    • Dependent packages count: 29.797%
    • Dependent repos count: 35.455%
    • Downloads: 53.011%
  • Maintainers (1)

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • 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
DESCRIPTION cran
  • R >= 3.5.0 depends
  • BayesianTools * suggests
  • R.rsp >= 0.40.0 suggests
  • dplyr * suggests
  • ggplot2 * suggests
  • knitr >= 1.15.1 suggests
  • rmarkdown >= 1.3 suggests
  • roxygen2 * suggests
  • sensitivity * suggests
  • testthat >= 1.0.2 suggests

Score: 10.770924118192763