-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
155 lines (115 loc) · 8.99 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# caribouMetrics
<!-- badges: start -->
[![R-CMD-check](https://github.com/LandSciTech/caribouMetrics/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/LandSciTech/caribouMetrics/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The caribouMetrics R package provides reproducible open source implementations of several models of Boreal woodland caribou (_Rangifer tarandus caribou_) demography and habitat use. A national two-stage demographic model with density dependence and interannual variability follows [Johnson et. al. (2020)](doi:10.1111/1365-2664.13637) with modifications described in [Dyson et al. (2022)](https://doi.org/10.1101/2022.06.01.494350). Demographic rates vary with disturbance as estimated by [Johnson et. al. (2020)](doi:10.1111/1365-2664.13637). The package also includes a Bayesian population model designed to integrate 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. The Bayesian population model builds on work by [Eacker et al. (2019)](https://doi.org/10.1002/wsb.950). The national model can be used to simulate example population trajectories, and combined with a simple observation model and the Bayesian population model to show how monitoring requirements depend on landscape condition. Finally, caribouMetrics contains an implementation of [Hornseth and Rempel's (2016)](https://doi.org/10.1139/cjz-2015-0101) Ontario boreal caribou resource selection model described in [Dyson et al. (2022)](https://doi.org/10.1101/2022.06.01.494350). 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)](https://doi.org/10.1002/eap.2816) and a [Shiny app](https://landscitech.github.io/BayesianCaribouDemographicProjection/) designed to allow allow exploration of user-specified monitoring and disturbance scenarios.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("LandSciTech/caribouMetrics")
```
## Example
This is a basic example demonstrating all the primary functions of the package.
```{r example}
library(caribouMetrics)
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)
disturb_tbl <- results(disturb)
# Calculate demographic rates
demCoefs <- demographicCoefficients(replicates = 10)
demRates <- demographicRates(covTable = disturb_tbl,
popGrowthPars = demCoefs)
demRates
# Simulate population growth
popGrow <- caribouPopGrowth(N = 2000, numSteps = 20, R_bar = demRates$R_bar,
S_bar = demRates$S_bar)
popGrow
# 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, printPlot = TRUE)
ipm <- caribouBayesianPM(simObs$simSurvObs, simObs$ageRatioOut,
simObs$simDisturbance,
# only set to speed up vignette. Normally keep defaults.
Niter = 150, Nburn = 100)
natSim <- getSimsNational(Anthro = unique(simObs$simDisturbance$Anthro))
ipmTbls <- getOutputTables(ipm, paramTable = simObs$paramTable,
exData = simObs$exData,
simNational = natSim)
plotRes(ipmTbls, c("Recruitment", "Adult female survival"))
# Calculate habitat use in Ontario's Churchill range
carHab1 <- caribouHabitat(
landCover = landCoverD,
esker = eskerDras,
natDist = natDistD,
anthroDist = anthroDistD,
linFeat = linFeatDras,
projectPoly = projectPolyD,
caribouRange = "Churchill"
)
# plot the results
plot(carHab1)
```
## Resources
The [package website](https://landscitech.github.io/caribouMetrics) contains information on the caribouMetrics package. Here you can find [documentation for each function](https://landscitech.github.io/caribouMetrics/reference/index.html) and the following articles/vignettes/tutorials:
* [**Demographic Model**](https://landscitech.github.io/caribouMetrics/articles/caribouDemography.html):
Predict demographic rates and population growth based on their relationship to habitat disturbance.
* [**Bayesian Demographic Projection**](https://landscitech.github.io/caribouMetrics/articles/BayesianDemographicProjection.html): Project demographic rates and population growth based on the national demographic model and local caribou observations.
* [**Disturbance Metrics**](https://landscitech.github.io/caribouMetrics/articles/Using_disturbanceMetrics.html): Calculate buffered anthropogenic disturbance and fire disturbance percentages for a given area.
* [**Ontario Habitat Model**](https://landscitech.github.io/caribouMetrics/articles/Using_caribouHabitat.html): Calculate caribou habitat use with Ontario RSF models.
* [**User Interface Help**](https://landscitech.github.io/caribouMetrics/articles/UI_help.html): Instructions for using the SyncroSim user interface for integrating SpaDES, LandR and FireSense projections with caribou habitat and demographic models (WIP)
## Getting help
If you have any questions about the caribouMetrics package or suggestions for improving it, please [post an issue on the code repository](https://github.com/LandSciTech/caribouMetrics/issues/new).
# References
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
Eacker, D.R., Hebblewhite, M., Steenweg, R., Russell, M., Flasko, A. and Hervieux, D., 2019. Web‐based application for threatened woodland caribou population modeling. Wildlife Society Bulletin, 43(1), pp.167-177. https://doi.org/10.1002/wsb.950
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
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.