You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,16 +49,18 @@ install.packages("blockCV")
49
49
50
50
### Sitemap
51
51
52
-
This GitHub project is organized into general sections of our modeling pipeline. Each article can be found in [vignettes](https://github.com/ieco-lab/scari/tree/master/vignettes). Please see this sitemap for navigating both the GitHub repo and our site:
52
+
This GitHub project is organized into two groups: vignettes which generate reports for SLF risk to viticulture based on our analysis, and our full modeling pipeline used to create these reports.
53
+
54
+
Reports can be generated using vignettes 150-152, which contain example usage of our function [create_risk_report()](vignettes/150_create_risk_report.Rmd) (150) to create reports for global countries and states/provinces (151), and for the USA specifically (152).
55
+
56
+
Please see this sitemap for a guide to our full modeling pipeline:
53
57
54
58
* vignette 010: Initialize `scari` and usage of `renv` package for dependencies
55
-
* 020-030: 1. Retrieve and tidy input data for MaxEnt
56
-
* 040-090: 2. SDM modeling pipeline: train global and 3 regional-scale models
57
-
* 100-110: 3. Ensemble Regional-scale SDMs
58
-
* 120-130: 4. Quantify SLF risk
59
-
* 140-142: 5. Quantify Model fit
60
-
* 150-152: Example usage of our function [create_risk_report()](vignettes/150_create_risk_report.Rmd) (150) to create reports for global countries and states/provinces (151), and for the USA specifically (152)
61
-
* 160: Generation of figures for the companion paper
59
+
* 020-030: 1. Retrieve and tidy input data for MaxEnt
60
+
* 040-090: 2. SDM modeling pipeline: train global and 3 regional-scale models
61
+
* 100-110: 3. Ensemble Regional-scale SDMs
62
+
* 120-130, 160: 4. Quantify SLF risk
63
+
* 140-142: 5. Quantify Model fit
62
64
63
65
## How to Use this Project
64
66
@@ -70,6 +72,8 @@ Before diving into this project and our modeling workflow, an end user should:
70
72
4. Run the first vignette, [010_initialize_renv](vignettes/010_initialize_pkg.Rmd), which initializes `renv` and lists our package's dependencies.
71
73
5. See "Get Started" for help in using our package to produce localized reports on SLF risk to viticulture or to recreate our analysis for another invasive species of interest
72
74
75
+
Once these steps are completed, the end user can get started either generating SLF reports, or following and editing the full modeling pipeline.
76
+
73
77
### Notes about using this package's code
74
78
75
79
I use some of the following conventions to ensure that the package's .html files render correctly, the code is not overly cumbersome to run, and that data aren't re-downloaded unnecessarily:
Copy file name to clipboardExpand all lines: vignettes/130_create_suitability_xy_plots_viticultural.Rmd
+173-2Lines changed: 173 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "Plot shift in SLF risk to important viticultural regions under climate c
3
3
output: rmarkdown::html_document
4
4
author:
5
5
- "Samuel M. Owens^[Temple University, sam.owens@temple.edu, [ORCID](https://orcid.org/0009-0001-2338-7928)]"
6
-
date: "2025-08-04"
6
+
date: "2026-01-27"
7
7
---
8
8
9
9
# Overview
@@ -14,7 +14,7 @@ In this vignette, I will focus on making more specific predictions for SLF estab
14
14
15
15
Gallien et al, 2012 originally defined this method for discerning the "stage of invasion" for invasive populations according to different scales of SDM. I will apply this method and re-interpret it as a method for assessing the risk of establishment. These two models will not completely agree on the suitability for a particular location, so agreement between the modeled scales can give us more confidence in that prediction. Where the modeled scales disagree, we might make different interpretations of the biological mechanism at play.
16
16
17
-
```{r example quadrant plot, echo = FALSE}
17
+
```{r example quadrant plot, echo = FALSE, message = FALSE}
18
18
19
19
library(tidyverse)
20
20
@@ -1381,3 +1381,174 @@ We now have risk quadrant plots and tables that we can use to assess the level o
1381
1381
1382
1382
2. Smith, T. 2021, August 11. Evaluating Invasion Stage with SDMs - plantarum.ca. <https://plantarum.ca/2021/08/11/invasion-stage/>.
1383
1383
1384
+
<!--
1385
+
1386
+
# Appendix
1387
+
1388
+
## plot unweighted mean versions of suitability plots
1389
+
1390
+
This workflow follows steps 1-3, except that it plots based on the unweighted mean of the calculated regional ensemble (rather than an ensemble created based on AUC and ExDet weights).
Finally, I will load in the global and regional ensemble suitability maps. These will be used both for extracting the new xy suitability values and for plotting.
1401
+
1402
+
```{r load in suitability rasters}
1403
+
1404
+
# regional_ensemble
1405
+
regional_ensemble_1995_unweighted <- terra::rast(
1406
+
x = file.path(mypath, "slf_regional_ensemble_v2", "ensemble_regional_unweighted_mean_globe_1981-2010.asc")
1407
+
)
1408
+
1409
+
regional_ensemble_2055_unweighted <- terra::rast(
1410
+
x = file.path(mypath, "slf_regional_ensemble_v2", "ensemble_regional_unweighted_mean_globe_2041-2070_GFDL_ssp_averaged.asc")
1411
+
)
1412
+
1413
+
```
1414
+
1415
+
### Retrieve/Import xy suitability
1416
+
1417
+
These scatter plots will be based on the suitability for the IVR points in both the global and regional_ensemble models. I have already calculated the xy suitability for the global model based on these points, using the function `slfSpread::predict_xy_suitability()`. This function will not work for the regional_ensemble because it calls for a model object, which we did not use to predict the ensemble suitability. So, I will use `terra::extract()` to perform this action.
1418
+
1419
+
I will retrieve the suitability values for the regional_ensemble. Instead of returning the coordinates from the map, I will join the coordinates from the original IVR_locations dataset so that the coordinates are exact for joining with other datasets.
1420
+
1421
+
```{r retrieve xy suitability for regional_ensemble}
geom_hline(yintercept = as.numeric(summary_regional_ensemble_unweighted[2, 2]), linetype = "dashed", linewidth = 0.7) + # regional_ensemble- there are two MTSS thresholds for this model, but the difference is so small that you will never see it on the plot
1517
+
# historical data
1518
+
geom_point(
1519
+
aes(x = xy_global_1995, y = xy_regional_ensemble_1995_unweighted, shape = "Present"),
1520
+
size = 2, stroke = 0.7, color = "black", fill = "orchid1"
1521
+
) +
1522
+
# GFDL ssp370 data
1523
+
geom_point(
1524
+
aes(x = xy_global_2055, y = xy_regional_ensemble_2055_unweighted, shape = "Future | GFDL-ESM4\nmean of ssp126/370/585"),
1525
+
size = 2, stroke = 0.7, color = "black", fill = "purple3"
0 commit comments