
Create risk reports for global countries and provinces
Samuel M. Owens1
2025-08-07
Source:vignettes/151_create_risk_report_global.Rmd
151_create_risk_report_global.Rmd
VIGNETTE UNDER CONSTRUCTION
# general tools
library(tidyverse)
library(cli)
library(here)
library(common)
# spatial data
library(terra)
library(sf)
library(rnaturalearth)
library(rnaturalearthhires)
library(rnaturalearthdata)
library(ggspatial)
# aesthetics
library(kableExtra)
library(formattable)
library(webshot)
library(webshot2)
library(ggnewscale) ## MUST use version 0.4.10- 0.5.0 has a bug that breaks this function
# for analysis
library(patchwork)
library(gginnards)
library(scari)
Note: I will be setting the global options of this
document so that only certain code chunks are rendered in the final
.html file. I will set the eval = FALSE
so that none of the
code is re-run (preventing files from being overwritten during knitting)
and will simply overwrite this in chunks with plots.
Generate Individual country and state/province reports
Alternatively, I will create individualized reports and maps for key viticultural areas of interest. I will group these regions by expected gain or loss in viticultural risk, and by geography. I will start out with the USA and China because they each contain so many SLF records and because I want to create reports for specific provinces within these countries.
China
scari::create_risk_report(
locality.iso = "chn",
locality.name = "china",
locality.type = "country",
mypath = file.path(here::here(), "vignette-outputs", "reports", "China"),
create.dir = FALSE,
save.report = FALSE,
buffer.dist = 20000
)
## ℹ proceeding without creating report output subdirectory folder
## Reading layer `ne_10m_admin_0_countries' from data source
## `C:\Users\tun83449\OneDrive - Temple University\Shared drives\slfClimate\projects\scari\scari\data-raw\ne_countries\ne_10m_admin_0_countries.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 258 features and 168 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -90 xmax: 180 ymax: 83.6341
## Geodetic CRS: WGS 84
## ℹ Importing shapefiles from: C:/Users/tun83449/OneDrive - Temple University/Shared drives/slfClimate/projects/scari/scari/data-raw
## Reading layer `ne_10m_admin_1_states_provinces' from data source
## `C:\Users\tun83449\OneDrive - Temple University\Shared drives\slfClimate\projects\scari\scari\data-raw\ne_states_provinces\ne_10m_admin_1_states_provinces.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 4596 features and 121 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -90 xmax: 180 ymax: 83.6341
## Geodetic CRS: WGS 84
## ✔ Data exist for locality
## ℹ Suitability prediction type for IVR regions: buffer of 20000m around points
## ✔ Risk maps plotted
## ✔ Range shift map plotted
## ✔ Viticultural risk plot created
## ✔ Viticultural regions list created
## ✔ Risk map proportional areas table created
## ✔ Range shift area table created
## ✔ Viticultural risk table created
## ✔ Report created
## ✔ Report NOT saved to file
# this report should have 2 IVR points
scari::create_risk_report(
locality.iso = "chn",
locality.name = "shandong",
locality.type = "state_province",
mypath = file.path(here::here(), "vignette-outputs", "reports", "China"),
create.dir = FALSE,
save.report = FALSE,
buffer.dist = 20000
)
## ℹ proceeding without creating report output subdirectory folder
## Reading layer `ne_10m_admin_0_countries' from data source
## `C:\Users\tun83449\OneDrive - Temple University\Shared drives\slfClimate\projects\scari\scari\data-raw\ne_countries\ne_10m_admin_0_countries.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 258 features and 168 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -90 xmax: 180 ymax: 83.6341
## Geodetic CRS: WGS 84
## ℹ Importing shapefiles from: C:/Users/tun83449/OneDrive - Temple University/Shared drives/slfClimate/projects/scari/scari/data-raw
## Reading layer `ne_10m_admin_1_states_provinces' from data source
## `C:\Users\tun83449\OneDrive - Temple University\Shared drives\slfClimate\projects\scari\scari\data-raw\ne_states_provinces\ne_10m_admin_1_states_provinces.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 4596 features and 121 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -90 xmax: 180 ymax: 83.6341
## Geodetic CRS: WGS 84
## ✔ Data exist for locality
## ℹ Suitability prediction type for IVR regions: buffer of 20000m around points
## ✔ Risk maps plotted
## ✔ Range shift map plotted
## ✔ Viticultural risk plot created
## ✔ Viticultural regions list created
## ✔ Risk map proportional areas table created
## ✔ Range shift area table created
## ✔ Viticultural risk table created
## ✔ Report created
## ✔ Report NOT saved to file
# this report should have no IVR records
scari::create_risk_report(
locality.iso = "chn",
locality.name = "yunnan",
locality.type = "state_province",
mypath = file.path(here::here(), "vignette-outputs", "reports", "China"),
create.dir = FALSE,
save.report = FALSE,
buffer.dist = 20000
)
## ℹ proceeding without creating report output subdirectory folder
## Reading layer `ne_10m_admin_0_countries' from data source
## `C:\Users\tun83449\OneDrive - Temple University\Shared drives\slfClimate\projects\scari\scari\data-raw\ne_countries\ne_10m_admin_0_countries.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 258 features and 168 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -90 xmax: 180 ymax: 83.6341
## Geodetic CRS: WGS 84
## ℹ Importing shapefiles from: C:/Users/tun83449/OneDrive - Temple University/Shared drives/slfClimate/projects/scari/scari/data-raw
## Reading layer `ne_10m_admin_1_states_provinces' from data source
## `C:\Users\tun83449\OneDrive - Temple University\Shared drives\slfClimate\projects\scari\scari\data-raw\ne_states_provinces\ne_10m_admin_1_states_provinces.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 4596 features and 121 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -90 xmax: 180 ymax: 83.6341
## Geodetic CRS: WGS 84
## ✔ Data exist for locality
## ℹ Suitability prediction type for IVR regions: buffer of 20000m around points
## Warning: [buffer] empty SpatVector
## ✔ Risk maps plotted
## ✔ Range shift map plotted
## ✔ Viticultural risk plot created
## ✔ Viticultural regions list created
## ✔ Risk map proportional areas table created
## ✔ Range shift area table created
## ✔ Viticultural risk table created
## ✔ Report created
## ✔ Report NOT saved to file
# it worked still so thats good
# save report for other uses
# readr::write_rds(china_slf_risk_report, file = file.path(here::here(), "vignette-outputs", "reports", "China", "china_slf_risk_report.rds"))
Viticultural shifts due to climate change
Now, I will apply this function for specific countries of future viticultural interest.
Morales-Castilla et al 2020 predicted that the following countries would experience a loss in suitability for viticulture under a 4C warming scenario of climate change:
highest losses: * Italy * Spain
others: * Turkey * South Africa * Portugal * mexico
Concurrently, they predicted that the following areas would experience a gain in suitability under the same scenario:
- Pacific Northwestern States (USA)
- New Zealand
- Great Britain
- Ireland
- Sweden
Finally, some countries are expected to experience a more balanced ratio of losses and gains in suitability:
- France
Another paper, Webb et al 2013 predicted analogous climates for specific Vitis cultivars under climate change. This paper focused more on predicting where specific cultivars might move as growers keep pace with climate change. Based on predicted climate shifts in temperature and precipitation, this study predicts that the following areas will be generally less suitable for Vitis cultivars in the future:
- Central valley, California, USA
- Hotter parts of Australia
References
Webb, L. B., Watterson, I., Bhend, J., Whetton, P. H., & Barlow, E. W. R. (2013). Global climate analogues for winegrowing regions in future periods: Projections of temperature and precipitation. Australian Journal of Grape and Wine Research, 19(3), 331–341. https://doi.org/10.1111/ajgw.12045
Morales-Castilla, I., García de Cortázar-Atauri, I., Cook, B. I., Lacombe, T., Parker, A., van Leeuwen, C., Nicholas, K. A., & Wolkovich, E. M. (2020). Diversity buffers winegrowing regions from climate change losses. Proceedings of the National Academy of Sciences, 117(6), 2864–2869. https://doi.org/10.1073/pnas.1906731117