Skip to contents

The caribouMetrics R package provides implementations of models of Boreal woodland caribou (Rangifer tarandus caribou) demography described in Hughes et al. (2025). These include:

  • a national demographic model with density dependence and interannual variability follows Johnson et. al. (2020) with modifications described in Dyson et al. (2022). Demographic rates vary with disturbance as estimated by Johnson et. al. (2020).
  • a Bayesian Beta model for integrating prior information from Johnson et al’s national analysis of demographic-disturbance relationships with available local demographic data to reduce uncertainty in population viability projections (Hughes et al. 2025).

To facilitate comparison with Bayesian logistic models implemented in the bboutools R package (Dalgarno et al. 2025) caribouMetrics also allows for the use of those models. To align with bboutools note that the Hughes et al. (2025) model has been extended as follows:

Simulated example population trajectories can be created from the national model or fitted Bayesian models, and combined with a simple observation model and the Bayesian population model to explore monitoring scenarios and show how monitoring requirements depend on landscape condition (Hughes et al. 2025).

caribouMetrics also contains an implementation of Hornseth and Rempel’s (2016) Ontario boreal caribou resource selection model described in Dyson et al. (2022).

Model implementation is intended to be modular and flexible, allowing reuse of components in a variety of contexts including projections of the cumulative effects of disturbance and climate change (e.g. Stewart et al. 2023).

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("LandSciTech/caribouMetrics")

Example

This is a basic example demonstrating all the primary functions of the package.

library(caribouMetrics)
#> Loading required package: nimble
#> Warning: package 'nimble' was built under R version 4.3.3
#> nimble version 1.3.0 is loaded.
#> For more information on NIMBLE and a User Manual,
#> please visit https://R-nimble.org.
#> 
#> Note for advanced users who have written their own MCMC samplers:
#>   As of version 0.13.0, NIMBLE's protocol for handling posterior
#>   predictive nodes has changed in a way that could affect user-defined
#>   samplers in some situations. Please see Section 15.5.1 of the User Manual.
#> 
#> Attaching package: 'nimble'
#> The following object is masked from 'package:stats':
#> 
#>     simulate
# use local version on local and installed on GH
if(requireNamespace("devtools", quietly = TRUE)) devtools::load_all()
#> ℹ Loading caribouMetrics
#> Registered S3 method overwritten by 'mcmcr':
#>   method               from 
#>   as.mcmc.list.mcarray rjags
#> Warning: package 'testthat' was built under R version 4.3.3

pthBase <- system.file("extdata", package = "caribouMetrics")

# load example data
landCoverD <- terra::rast(file.path(pthBase, "landCover.tif")) 
  # convert PLC classes to resource types used in the model 
landCoverD <- reclassPLC(landCoverD)
eskerDras <- terra::rast(file.path(pthBase, "eskerTif.tif"))
eskerDshp <- sf::read_sf(file.path(pthBase, "esker.shp"))
natDistD <- terra::rast(file.path(pthBase, "natDist.tif"))
anthroDistD <-terra::rast(file.path(pthBase, "anthroDist.tif"))
linFeatDras <- terra::rast(file.path(pthBase, "linFeatTif.tif"))
projectPolyD <- sf::read_sf(file.path(pthBase, "projectPoly.shp"))

# calculate disturbance 
disturb <- disturbanceMetrics(landCover = landCoverD,
                              linFeat = linFeatDras,  
                              natDist = natDistD,
                              projectPoly = projectPolyD)
#> cropping landCover to extent of projectPoly
#> cropping linFeat to extent of projectPoly
#> cropping natDist to extent of projectPoly
#> buffering anthropogenic disturbance
#> calculating disturbance metrics

disturb_tbl <- results(disturb)

# Calculate demographic rates
demCoefs <- demographicCoefficients(replicates = 10)

demRates <- demographicRates(covTable = disturb_tbl,
                             popGrowthPars = demCoefs)
#> popGrowthPars contains quantiles so they are used instead of the defaults
#> popGrowthPars contains quantiles so they are used instead of the defaults
demRates
#>   zone   Anthro     Fire Total_dist fire_excl_anthro FID     S_bar S_stdErr
#> 1    1 39.97933 1.732936   40.56555        0.5862182   0 0.8478733 0.050644
#>     S_PIlow  S_PIhigh     R_bar   R_stdErr   R_PIlow  R_PIhigh
#> 1 0.7690494 0.9321272 0.1813372 0.09859156 0.0538864 0.3760678

# Simulate population growth
popGrow <- caribouPopGrowth(N = 2000, numSteps = 20, R_bar = demRates$R_bar, 
                            S_bar = demRates$S_bar)

popGrow
#>     N0   lambda   lambdaE   N      R_t      X_t       S_t n_recruits
#> 1 2000 0.945426 0.9247487 651 0.216816 0.108408 0.8930332         64
#>   surviving_adFemales
#> 1                 587

# simulate caribou collar observations
params <- getScenarioDefaults(
  iAnthro = disturb_tbl$Anthro, iFire = disturb_tbl$Fire,
  collarCount = 30, cowMult = 3, 
  obsAnthroSlope = 0, projAnthroSlope = 1, projYears = 10, obsYears = 10
)
simObs <- simulateObservations(params)

#devtools::load_all()
pm <- caribouBayesianPM(simObs$simSurvObs, simObs$simRecruitObs, 
                         simObs$simDisturbance,
                         # only set to speed up vignette. Normally keep defaults.
                         niters=100)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 10
#>    Unobserved stochastic nodes: 33
#>    Total graph size: 449
#> 
#> Initializing model
#> 
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 29
#>    Unobserved stochastic nodes: 70
#>    Total graph size: 505
#> 
#> Initializing model

natSim <- getSimsInitial(simObs$simDisturbance)
#> Warning: Setting expected survival S_bar to be between l_S and h_S.

pmTbls <- getOutputTables(pm, simInitial=natSim)
plotRes(pmTbls, c("Recruitment", "Adult female survival"))
#> $Recruitment

#> 
#> $`Adult female survival`


# Calculate habitat RSF in Ontario's Churchill range
carHab1 <- caribouHabitat(
  landCover = landCoverD,
  esker = eskerDras, 
  natDist = natDistD, 
  anthroDist = anthroDistD, 
  linFeat = linFeatDras, 
  projectPoly = projectPolyD,
  caribouRange = "Churchill"
)
#> cropping landCover to extent of projectPoly
#> cropping linFeat to extent of projectPoly
#> cropping natDist to extent of projectPoly
#> cropping anthroDist to extent of projectPoly
#> cropping esker to extent of projectPoly
#> resampling linFeat to match landCover resolution
#> resampling esker to match landCover resolution
#> Applying moving window.

# plot the results
plot(carHab1)
#> tmap must be attached with library(tmap) to be used. Using terra instead.

Resources

The package website contains information on the caribouMetrics package. Here you can find documentation for each function and the following articles/vignettes/tutorials:

  • Demographic Model: Simulate demographic rates and population growth using a national model informed by demographic-disturbance relationships.
  • Bayesian Demographic Projection: Estimate and project demographic rates and population growth using a Bayesian model informed by national demographic-disturbance relationships and local demographic data.
  • Comparing the caribouMetrics Beta model to bboutools models: Estimate and project demographic rates and population growth using Bayesian logistic models implemented in the bboutools R package, and compare to Beta models informed by national demographic-disturbance relationships and local demographic data.
  • Disturbance Metrics: Calculate buffered anthropogenic disturbance and fire disturbance percentages for a given area.

Getting help

If you have any questions about the caribouMetrics package or suggestions for improving it, please post an issue on the code repository.

References

Dalgarno S, Boulanger J, Pearson A, et al (2025) bbousuite: A set of R packages to facilitate analysis of boreal caribou survival and recruitment data. Journal of Open Source Software 10:7997. https://doi.org/10.21105/joss.07997

Dyson, M., Endicott, S., Simpkins C., Turner, J.W., Avery-Gomm S., Johnson, C.A., Leblond, M., Neilson, E.W., Rempel, R., Wiebe, P.A., Baltzer, J.L., Stewart, F.E.C., Hughes, J. 2022. Existing caribou habitat and demographic models are poorly suited for Ring of Fire impact assessment: A roadmap for improving the usefulness, transparency, and availability of models for conservation. bioRxiv 2022.06.01.494350; https://doi.org/10.1101/2022.06.01.494350

ECCC. 2011. Scientific assessment to inform the identification of critical habitat for woodland caribou (Rangifer tarandus caribou), boreal population, in Canada. Canadian Wildlife Service, Ottawa. http://epe.lac-bac.gc.ca/100/200/301/environment_can/2011/scientific_assessment_inform-ef/CW66-296-2011-eng.pdf. Accessed 26 Mar 2021.

Hornseth, M.L. and Rempel, R.S., 2016. Seasonal resource selection of woodland caribou (Rangifer tarandus caribou) across a gradient of anthropogenic disturbance. Canadian Journal of Zoology, 94(2), pp.79-93. https://doi.org/10.1139/cjz-2015-0101

Hughes J, Endicott S, Calvert AM, Johnson CA (2025) Integration of national demographic-disturbance relationships and local data can improve caribou population viability projections and inform monitoring decisions. Ecological Informatics 87:103095. https://doi.org/10.1016/j.ecoinf.2025.103095

Johnson, C.A., Sutherland, G.D., Neave, E., Leblond, M., Kirby, P., Superbie, C. and McLoughlin, P.D., 2020. Science to inform policy: linking population dynamics to habitat for a threatened species in Canada. Journal of Applied Ecology, 57(7), pp.1314-1327. https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/1365-2664.13637

Stewart F.E.C., Micheletti T., Cumming S.G., Barros, C., Chubaty, A. M., Dookie, A. L., Duclos, I., Eddy, I., Haché, S., Hodson, J., Hughes, J., Johnson, C. A., Leblond, M., Schmiegelow, F.K.A., Tremblay, J. A.. McIntire, E.J.B. (2023) Climate-informed forecasts reveal dramatic local habitat shifts and population uncertainty for northern boreal caribou. Ecological Applications 33:e2816. https://doi.org/10.1002/eap.2816

License

caribouMetrics - Terms and Condition of Use

Unless otherwise noted, source code of the caribouMetrics R package is covered under Crown Copyright, Government of Canada, and distributed under the GPL3 license.

Copyright (C) Her Majesty the Queen in Right of Canada as represented by the Minister of the Environment 2021/(C) Sa Majesté la Reine du chef du Canada représentée par le ministre de l’Environnement 2021.