From 0ec800929ab8a23d1c6e0f210846ab497e3d3239 Mon Sep 17 00:00:00 2001
From: silasprincipe <53846571+silasprincipe@users.noreply.github.com>
Date: Mon, 12 Aug 2024 21:15:25 +0200
Subject: [PATCH] Pre publication
---
.gitignore | 5 +-
README.md | 54 +
README.qmd | 54 +
codes/plot_lgcp_summaps.R | 1009 ++++----
codes/plot_lgcp_supp.R | 916 +++----
codes/plot_lgcp_threshextrap.R | 1143 +++++++++
codes/plot_mess_temp.R | 612 +++++
codes/plot_sstpoints_lims.R | 1 +
docs/echinometra.html | 1411 +++++++++++
docs/images/eclu_cifonauta.jpg | Bin 0 -> 112583 bytes
docs/images/lyva_cifonauta.jpeg | Bin 0 -> 146115 bytes
docs/images/trve_cifonauta.jpg | Bin 0 -> 92223 bytes
docs/index.html | 593 +++++
docs/lytechinus.html | 1410 +++++++++++
docs/methods.html | 588 +++++
docs/search.json | 107 +
.../Proj4Leaflet-1.0.1/proj4leaflet.js | 544 ++--
docs/site_libs/bootstrap/bootstrap-icons.css | 2078 +++++++++++++++
docs/site_libs/bootstrap/bootstrap-icons.woff | Bin 0 -> 176200 bytes
docs/site_libs/bootstrap/bootstrap.min.css | 12 +
docs/site_libs/bootstrap/bootstrap.min.js | 7 +
docs/site_libs/clipboard/clipboard.min.js | 7 +
.../site_libs/htmltools-fill-0.5.8.1/fill.css | 21 +
.../htmlwidgets-1.6.4}/htmlwidgets.js | 56 +-
.../site_libs/jquery-3.6.0/jquery-3.6.0.js | 0
.../jquery-3.6.0/jquery-3.6.0.min.js | 0
.../jquery-3.6.0/jquery-3.6.0.min.map | 0
.../leaflet-1.3.1/images/layers-2x.png | Bin
.../site_libs/leaflet-1.3.1/images/layers.png | Bin
.../leaflet-1.3.1/images/marker-icon-2x.png | Bin
.../leaflet-1.3.1/images/marker-icon.png | Bin
.../leaflet-1.3.1/images/marker-shadow.png | Bin
.../site_libs/leaflet-1.3.1/leaflet.css | 1272 +++++-----
.../site_libs/leaflet-1.3.1/leaflet.js | 0
.../leaflet-binding-2.2.2}/leaflet.js | 61 +-
.../leaflet-providers_2.0.0.js | 1178 +++++++++
.../leaflet-providers-plugin.js | 3 +
.../site_libs/leafletfix-1.0.0/leafletfix.css | 10 +-
.../site_libs/proj4-2.6.2/proj4.min.js | 0
docs/site_libs/quarto-html/anchor.min.js | 9 +
docs/site_libs/quarto-html/popper.min.js | 6 +
.../quarto-syntax-highlighting.css | 205 ++
docs/site_libs/quarto-html/quarto.js | 908 +++++++
docs/site_libs/quarto-html/tippy.css | 1 +
docs/site_libs/quarto-html/tippy.umd.min.js | 2 +
docs/site_libs/quarto-nav/headroom.min.js | 7 +
docs/site_libs/quarto-nav/quarto-nav.js | 325 +++
.../quarto-search/autocomplete.umd.js | 3 +
docs/site_libs/quarto-search/fuse.min.js | 9 +
docs/site_libs/quarto-search/quarto-search.js | 1290 ++++++++++
.../rstudio_leaflet-1.3.1/images/1px.png | Bin
.../rstudio_leaflet-1.3.1/rstudio_leaflet.css | 0
docs/styles.css | 1 +
docs/thermal.html | 1030 ++++++++
.../figure-html/unnamed-chunk-1-1.png | Bin 0 -> 169295 bytes
docs/tripneustes.html | 1411 +++++++++++
logo.jpg | Bin 0 -> 22341 bytes
report/.nojekyll | 0
report/_site.yml | 34 -
report/about.Rmd | 10 -
report/docs/about.html | 2129 ----------------
report/docs/index.html | 2172 ----------------
.../figure-html5/unnamed-chunk-1-1.png | Bin 66039 -> 0 bytes
report/docs/search.json | 34 -
.../docs/site_libs/anchor-4.2.2/anchor.min.js | 9 -
.../autocomplete-0.37.1/autocomplete.min.js | 7 -
.../docs/site_libs/bowser-1.9.3/bowser.min.js | 6 -
.../site_libs/distill-2.2.21/template.v2.js | 744 ------
.../site_libs/font-awesome-5.1.0/css/all.css | 5 -
.../font-awesome-5.1.0/css/v4-shims.css | 2170 ----------------
.../webfonts/fa-brands-400.eot | Bin 115052 -> 0 bytes
.../webfonts/fa-brands-400.svg | 1127 ---------
.../webfonts/fa-brands-400.ttf | Bin 114816 -> 0 bytes
.../webfonts/fa-brands-400.woff | Bin 73920 -> 0 bytes
.../webfonts/fa-brands-400.woff2 | Bin 63376 -> 0 bytes
.../webfonts/fa-regular-400.eot | Bin 40744 -> 0 bytes
.../webfonts/fa-regular-400.svg | 467 ----
.../webfonts/fa-regular-400.ttf | Bin 40516 -> 0 bytes
.../webfonts/fa-regular-400.woff | Bin 18212 -> 0 bytes
.../webfonts/fa-regular-400.woff2 | Bin 14952 -> 0 bytes
.../webfonts/fa-solid-900.eot | Bin 160768 -> 0 bytes
.../webfonts/fa-solid-900.svg | 2231 -----------------
.../webfonts/fa-solid-900.ttf | Bin 160548 -> 0 bytes
.../webfonts/fa-solid-900.woff | Bin 76632 -> 0 bytes
.../webfonts/fa-solid-900.woff2 | Bin 59572 -> 0 bytes
report/docs/site_libs/fuse-6.4.1/fuse.min.js | 9 -
.../header-attrs-2.13/header-attrs.js | 12 -
.../site_libs/headroom-0.9.4/headroom.min.js | 7 -
.../site_libs/jquery-1.12.4/jquery.min.js | 5 -
.../docs/site_libs/popper-2.6.0/popper.min.js | 6 -
.../tippy-6.2.7/tippy-bundle.umd.min.js | 2 -
.../tippy-6.2.7/tippy-light-border.css | 1 -
report/docs/site_libs/tippy-6.2.7/tippy.css | 1 -
.../site_libs/tippy-6.2.7/tippy.umd.min.js | 2 -
.../webcomponents-2.0.0/webcomponents.js | 236 --
report/index.Rmd | 53 -
96 files changed, 16355 insertions(+), 13483 deletions(-)
create mode 100644 README.md
create mode 100644 README.qmd
create mode 100644 codes/plot_lgcp_threshextrap.R
create mode 100644 codes/plot_mess_temp.R
create mode 100644 docs/echinometra.html
create mode 100644 docs/images/eclu_cifonauta.jpg
create mode 100644 docs/images/lyva_cifonauta.jpeg
create mode 100644 docs/images/trve_cifonauta.jpg
create mode 100644 docs/index.html
create mode 100644 docs/lytechinus.html
create mode 100644 docs/methods.html
create mode 100644 docs/search.json
rename {report/docs => docs}/site_libs/Proj4Leaflet-1.0.1/proj4leaflet.js (96%)
create mode 100644 docs/site_libs/bootstrap/bootstrap-icons.css
create mode 100644 docs/site_libs/bootstrap/bootstrap-icons.woff
create mode 100644 docs/site_libs/bootstrap/bootstrap.min.css
create mode 100644 docs/site_libs/bootstrap/bootstrap.min.js
create mode 100644 docs/site_libs/clipboard/clipboard.min.js
create mode 100644 docs/site_libs/htmltools-fill-0.5.8.1/fill.css
rename {report/docs/site_libs/htmlwidgets-1.5.4 => docs/site_libs/htmlwidgets-1.6.4}/htmlwidgets.js (96%)
rename {report/docs => docs}/site_libs/jquery-3.6.0/jquery-3.6.0.js (100%)
rename {report/docs => docs}/site_libs/jquery-3.6.0/jquery-3.6.0.min.js (100%)
rename {report/docs => docs}/site_libs/jquery-3.6.0/jquery-3.6.0.min.map (100%)
rename {report/docs => docs}/site_libs/leaflet-1.3.1/images/layers-2x.png (100%)
rename {report/docs => docs}/site_libs/leaflet-1.3.1/images/layers.png (100%)
rename {report/docs => docs}/site_libs/leaflet-1.3.1/images/marker-icon-2x.png (100%)
rename {report/docs => docs}/site_libs/leaflet-1.3.1/images/marker-icon.png (100%)
rename {report/docs => docs}/site_libs/leaflet-1.3.1/images/marker-shadow.png (100%)
rename {report/docs => docs}/site_libs/leaflet-1.3.1/leaflet.css (95%)
rename {report/docs => docs}/site_libs/leaflet-1.3.1/leaflet.js (100%)
rename {report/docs/site_libs/leaflet-binding-2.1.0 => docs/site_libs/leaflet-binding-2.2.2}/leaflet.js (91%)
create mode 100644 docs/site_libs/leaflet-providers-2.0.0/leaflet-providers_2.0.0.js
create mode 100644 docs/site_libs/leaflet-providers-plugin-2.2.2/leaflet-providers-plugin.js
rename {report/docs => docs}/site_libs/leafletfix-1.0.0/leafletfix.css (83%)
rename {report/docs => docs}/site_libs/proj4-2.6.2/proj4.min.js (100%)
create mode 100644 docs/site_libs/quarto-html/anchor.min.js
create mode 100644 docs/site_libs/quarto-html/popper.min.js
create mode 100644 docs/site_libs/quarto-html/quarto-syntax-highlighting.css
create mode 100644 docs/site_libs/quarto-html/quarto.js
create mode 100644 docs/site_libs/quarto-html/tippy.css
create mode 100644 docs/site_libs/quarto-html/tippy.umd.min.js
create mode 100644 docs/site_libs/quarto-nav/headroom.min.js
create mode 100644 docs/site_libs/quarto-nav/quarto-nav.js
create mode 100644 docs/site_libs/quarto-search/autocomplete.umd.js
create mode 100644 docs/site_libs/quarto-search/fuse.min.js
create mode 100644 docs/site_libs/quarto-search/quarto-search.js
rename {report/docs => docs}/site_libs/rstudio_leaflet-1.3.1/images/1px.png (100%)
rename {report/docs => docs}/site_libs/rstudio_leaflet-1.3.1/rstudio_leaflet.css (100%)
create mode 100644 docs/styles.css
create mode 100644 docs/thermal.html
create mode 100644 docs/thermal_files/figure-html/unnamed-chunk-1-1.png
create mode 100644 docs/tripneustes.html
create mode 100644 logo.jpg
delete mode 100644 report/.nojekyll
delete mode 100644 report/_site.yml
delete mode 100644 report/about.Rmd
delete mode 100644 report/docs/about.html
delete mode 100644 report/docs/index.html
delete mode 100644 report/docs/index_files/figure-html5/unnamed-chunk-1-1.png
delete mode 100644 report/docs/search.json
delete mode 100644 report/docs/site_libs/anchor-4.2.2/anchor.min.js
delete mode 100644 report/docs/site_libs/autocomplete-0.37.1/autocomplete.min.js
delete mode 100644 report/docs/site_libs/bowser-1.9.3/bowser.min.js
delete mode 100644 report/docs/site_libs/distill-2.2.21/template.v2.js
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/css/all.css
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/css/v4-shims.css
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-brands-400.eot
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-brands-400.svg
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-brands-400.ttf
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-brands-400.woff
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-brands-400.woff2
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-regular-400.eot
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-regular-400.svg
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-regular-400.ttf
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-regular-400.woff
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-regular-400.woff2
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-solid-900.eot
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-solid-900.svg
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-solid-900.ttf
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-solid-900.woff
delete mode 100644 report/docs/site_libs/font-awesome-5.1.0/webfonts/fa-solid-900.woff2
delete mode 100644 report/docs/site_libs/fuse-6.4.1/fuse.min.js
delete mode 100644 report/docs/site_libs/header-attrs-2.13/header-attrs.js
delete mode 100644 report/docs/site_libs/headroom-0.9.4/headroom.min.js
delete mode 100644 report/docs/site_libs/jquery-1.12.4/jquery.min.js
delete mode 100644 report/docs/site_libs/popper-2.6.0/popper.min.js
delete mode 100644 report/docs/site_libs/tippy-6.2.7/tippy-bundle.umd.min.js
delete mode 100644 report/docs/site_libs/tippy-6.2.7/tippy-light-border.css
delete mode 100644 report/docs/site_libs/tippy-6.2.7/tippy.css
delete mode 100644 report/docs/site_libs/tippy-6.2.7/tippy.umd.min.js
delete mode 100644 report/docs/site_libs/webcomponents-2.0.0/webcomponents.js
delete mode 100644 report/index.Rmd
diff --git a/.gitignore b/.gitignore
index 8aa0b7c..2a0b8f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -82,4 +82,7 @@ rsconnect/
# Other folders
/supplement
/figures
-/results/*
\ No newline at end of file
+/results/*
+
+docs_raw/
+others/
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b11a973
--- /dev/null
+++ b/README.md
@@ -0,0 +1,54 @@
+
+
+
+
+# Modeling the Species Distribution of Sea Urchins in the Western Atlantic
+
+## Introduction
+
+This project assessed how climate change will impact the distribution of
+three key species of sea urchins in the Western Atlantic. This was done
+through SDMs produced using LGCP models under a Bayesian framework. For
+more details, reader is referred to the publication “A thorny future for
+sea urchins in the Tropical Western Atlantic” (under review). All codes
+and data used in the study are available in this folder, except original
+climatic layers, which are available online.
+
+## Interactive results
+
+An interactive version of the results of this work is availabe at
+[silasprincipe.github.io/herbinv](http://silasprincipe.github.io/herbinv)
+
+## Files included
+
+**data**: all data used in the study
+– **env**: environmental data
+– **lyva**: *Lytechinus variegatus* data
+– **eclu**: *Echinometra lucunter* data
+– **trve**: *Tripneustes ventricosus* data
+– **sst_limits**: SST data for the thermal limits part **codes**: all
+codes used in the study
+**functions**: all functions that were used either directly or as
+support in the study **gis**: shapefiles
+
+### Codes
+
+- data\_\*: data download and preparing
+- prep\_\*: prepare data (environmental variables)
+- lgcp_prepare_data: prepare all data necessary for fitting the LGCP
+ model through INLA
+- lgcp_model\_\*: models for each species
+- plot\_\*: produce figures
+- sst\_\*: codes used for producing the mechanistic model or for
+ estimating thermal limits
+- supp\_\*: supplementary analysis
+
+## Related repositories
+
+- Species Distribution Modeling of reef building coral species of the
+ Western Atlantic:
+ [silasprincipe/reefbuilders](https://github.com/silasprincipe/reefbuilders)
+
+------------------------------------------------------------------------
+
+Please, contact us if you have any questions on how to use the codes.
diff --git a/README.qmd b/README.qmd
new file mode 100644
index 0000000..f6d36bc
--- /dev/null
+++ b/README.qmd
@@ -0,0 +1,54 @@
+---
+format: gfm
+---
+
+
+
+```{r, echo = FALSE}
+knitr::opts_chunk$set(
+ collapse = TRUE,
+ comment = "#>",
+ fig.path = "figures/"
+)
+```
+
+# Modeling the Species Distribution of Sea Urchins in the Western Atlantic
+
+
+## Introduction
+
+This project assessed how climate change will impact the distribution of three key species of sea urchins in the Western Atlantic. This was done through SDMs produced using LGCP models under a Bayesian framework. For more details, reader is referred to the publication "A thorny future for sea urchins in the Tropical Western Atlantic" (under review). All codes and data used in the study are available in this folder, except original climatic layers, which are available online.
+
+## Interactive results
+
+An interactive version of the results of this work is availabe at [silasprincipe.github.io/herbinv](http://silasprincipe.github.io/herbinv)
+
+## Files included
+
+**data**: all data used in the study
+-- **env**: environmental data
+-- **lyva**: _Lytechinus variegatus_ data
+-- **eclu**: _Echinometra lucunter_ data
+-- **trve**: _Tripneustes ventricosus_ data
+-- **sst_limits**: SST data for the thermal limits part
+**codes**: all codes used in the study
+**functions**: all functions that were used either directly or as support in the study
+**gis**: shapefiles
+
+### Codes
+
+- data_*: data download and preparing
+- prep_*: prepare data (environmental variables)
+- lgcp_prepare_data: prepare all data necessary for fitting the LGCP model through INLA
+- lgcp_model_*: models for each species
+- plot_*: produce figures
+- sst_*: codes used for producing the mechanistic model or for estimating thermal limits
+- supp_*: supplementary analysis
+
+## Related repositories
+
+- Species Distribution Modeling of reef building coral species of the Western Atlantic: [silasprincipe/reefbuilders](https://github.com/silasprincipe/reefbuilders)
+
+---
+
+Please, contact us if you have any questions on how to use the codes.
diff --git a/codes/plot_lgcp_summaps.R b/codes/plot_lgcp_summaps.R
index 4b26d65..161ad09 100644
--- a/codes/plot_lgcp_summaps.R
+++ b/codes/plot_lgcp_summaps.R
@@ -597,509 +597,530 @@ ggsave(paste0("figures/summap_lgcp_composite.jpg"), final,
width = 50, height = 18, units = "cm", quality = 100)
-## Q0.5 quantile version ----
-# Load raster [new version]
-scen.rasts <- lapply(species, function(x){
+
+
+
+### Each species thresholded maps ----
+# Guide for legend
+step.guide <- guide_legend(title = "Suitability",
+ show.limits = TRUE,
+ keyheight = unit(0.2, "in"),
+ keywidth = unit(0.2, "in"),
+ ticks = T,
+ ticks.colour = "grey20",
+ frame.colour = "grey20",
+ title.position = "top",
+ title.hjust = 0.5,
+ label.position = "right",
+ label.hjust = 0.5)
+
+sca <- scale_fill_manual(values = rev(c("#4A64A9", "#24AD79")),
+ guide = step.guide)
+
+wlt <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_text(colour = "grey60", size = 14),
+ axis.title.x.top = element_text(vjust = 2, size = 16),
+ axis.title.y.left = element_text(size = 16),
+ panel.background = element_blank(),
+ panel.border = element_rect(fill = NA, color = "grey60"),
+ panel.grid.major = element_line(linetype = 'dashed',
+ colour = "grey70",
+ size = .1),
+ legend.position="bottom",
+ legend.title.align=0.5,
+ legend.text = element_text(size = 14),
+ legend.title = element_text(size = 16),
+ legend.background = element_rect(fill = "white"),
+ legend.spacing.x = unit(0.3, 'cm')
+ )
+
+
+for (i in 1:length(species)) {
- all.rast <- lapply(c("current", paste0("ssp", 1:3)), function(z){
- # Open files
- self <- list.files(paste0("results/", x, "/predictions/"),
- pattern = "mean", full.names = T)
- self <- self[grep(paste0("cont_", z), self)]
- r <- raster(self)
- return(r)
- })
+ sp <- species[i]
- all.rast <- stack(all.rast)
+ species.rast <- scen.rasts[[i]]
- # Load occurrence data
- proj <- "+proj=laea +lat_0=0 +lon_0=-70 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs"
- occ <- SpatialPoints(read.csv(paste0("data/", x, "/", x, "_filt.csv"))[,1:2],
- proj4string = CRS(proj))
+ total.area <- cellStats(species.rast, sum)
+ total.area[2:4] <- (total.area[2:4] * 100)/total.area[1]
+ total.area[2:4] <- total.area[2:4]-100
+ total.area[2:4] <- round(total.area[2:4], 1)
- ### Threhsolding
- get.thresh <- function(res, pts){
- vals <- raster::extract(res, pts)
- p10 <- ceiling(length(vals) * 0.9)
- thresh <- rev(sort(vals))[p10]
-
- res[res < thresh] <- NA
-
- secvals <- raster::extract(res, pts)
- secvals <- secvals[!is.na(secvals)]
- secthresh <- quantile(secvals, 0.5)
-
- return(c(thresh, secthresh))
- }
+ total.area[1] <- total.area[1] * prod(res(species.rast))
+ total.area[1] <- format(total.area[1], big.mark = ",", small.mark = ".", nsmall = 1)
+ total.area[1] <- paste0("Total area: ", total.area[1], "km²")
- threshs <- get.thresh(all.rast[[1]], occ)
+ total.area[2:4] <- paste0("Change in area: ", total.area[2:4], "%")
- classify <- function(scen, threshold){
- scen[scen < threshold] <- 0
- scen[scen >= threshold] <- 1
- return(scen)
- }
+ curr.v <- get.val(species.rast[[1]])
+ ssp1.v <- get.val(species.rast[[2]])
+ ssp2.v <- get.val(species.rast[[3]])
+ ssp3.v <- get.val(species.rast[[4]])
- for (i in 1:4) {
- all.rast[[i]] <- classify(all.rast[[i]], threshs[2])
- }
+ base.rast <- species.rast[[1]]
+ base.rast[base.rast < 1] <- NA
+ base.pred <- aggregate(buffer(rasterToPolygons(base.rast, dissolve = T), 0.0001))
+ base.pred <- sf::st_as_sf(base.pred)
- names(all.rast) <- paste(x, c("current", paste0("ssp", 1:3)), sep = "_")
+ curr.v$val <- ifelse(curr.v$val == 1, "Suitable", "Unsuitable")
+ ssp1.v$val <- ifelse(ssp1.v$val == 1, "Suitable", "Unsuitable")
+ ssp2.v$val <- ifelse(ssp2.v$val == 1, "Suitable", "Unsuitable")
+ ssp3.v$val <- ifelse(ssp3.v$val == 1, "Suitable", "Unsuitable")
- return(all.rast)
+ ##### Current ----
+
+ (pc <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Add occurrence points
+ # geom_point(data = data.frame(occ@coords),
+ # aes(x = decimalLongitude, y = decimalLatitude), size = 1,
+ # alpha = .2, shape = 16)+
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "N",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "A", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Add area
+ geom_label(aes(label = total.area[1], x = -3000, y = -4200),
+ size = 4, color = "grey30",
+ label.size = 0, hjust = "left") +
+ # Remove axis labels and add theme
+ xlab("Easting") + ylab("Northing") + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+ # Prepare insets
+ (pc.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ (pc.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ pcf <- pc +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(pc.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(pc.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ # ggsave(paste0("figures/summap_lgcp_current.jpg"), pcf,
+ # width = 16, height = 18, units = "cm")
+
+ #### SSP1 ----
+ (ps1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "B", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Add area
+ geom_label(aes(label = total.area[2], x = -3000, y = -4200),
+ size = 4, color = "grey30",
+ label.size = 0, hjust = "left") +
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+ # Prepare insets
+ (ps1.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ (ps1.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ ps1f <- ps1 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps1.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps1.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ ps1f.s <- ps1f + theme(legend.position = "none")
+
+ # ggsave(paste0("figures/summap_lgcp_ssp1.jpg"), ps1f.s,
+ # width = 16, height = 18, units = "cm")
+
+
+
+
+ #### SSP2 ----
+ (ps2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "C", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Add area
+ geom_label(aes(label = total.area[3], x = -3000, y = -4200),
+ size = 4, color = "grey30",
+ label.size = 0, hjust = "left") +
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+ # Prepare insets
+ (ps2.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ (ps2.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ ps2f <- ps2 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps2.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps2.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ ps2f.s <- ps2f + theme(legend.position = "none")
+
+ # ggsave(paste0("figures/summap_lgcp_ssp2.jpg"), ps2f.s,
+ # width = 16, height = 18, units = "cm")
+
+
+
+
+ #### SSP3 ----
+ (ps3 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "D", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Add area
+ geom_label(aes(label = total.area[4], x = -3000, y = -4200),
+ size = 4, color = "grey30",
+ label.size = 0, hjust = "left") +
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+ # Prepare insets
+ (ps3.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ (ps3.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ geom_sf(data = base.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ ps3f <- ps3 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps3.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps3.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ ps3f.s <- ps3f + theme(legend.position = "none")
+
+ # ggsave(paste0("figures/summap_lgcp_ssp3.jpg"), ps3f.s,
+ # width = 16, height = 18, units = "cm")
+
+ # Save composite ----
+ final <- pcf + ps1f + ps2f + ps3f + plot_layout(nrow = 1, guides = "collect") &
+ theme(legend.position='bottom')
+
+ ggsave(paste0("figures/lgcp_thresh_", sp, ".jpg"), final,
+ width = 50, height = 18, units = "cm", quality = 100)
-})
-
-
-
-sum.rasts <- scen.rasts[[1]] + scen.rasts[[2]] + scen.rasts[[3]]
-
-curr <- sum.rasts[[1]]
-ssp1 <- sum.rasts[[2]]
-ssp2 <- sum.rasts[[3]]
-ssp3 <- sum.rasts[[4]]
-
-# Convert to data.frame
-get.val <- function(x){
- temp <- as(x, "SpatialPixelsDataFrame")
- temp <- as.data.frame(temp)
- colnames(temp) <- c("val", "x", "y")
- temp$val <- as.factor(temp$val)
- return(temp)
}
-
-curr.v <- get.val(curr)
-ssp1.v <- get.val(ssp1)
-ssp2.v <- get.val(ssp2)
-ssp3.v <- get.val(ssp3)
-
-## Plot maps
-
-(pc <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Add occurrence points
- # geom_point(data = data.frame(occ@coords),
- # aes(x = decimalLongitude, y = decimalLatitude), size = 1,
- # alpha = .2, shape = 16)+
- # Establish area
- coord_sf(xlim = c(-3239.984, 4510.636),
- ylim = c(-4614.575, 4596.965),
- datum = st_crs(base),
- expand = F,
- label_axes = list(
- top = "E",
- left = "N",
- top = ""
- )) +
- # Draw rectangles
- geom_rect(data = rects[[1]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- geom_rect(data = rects[[2]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- # Add title
- geom_label(aes(label = "A", x = 4000, y = 4100),
- size = 10, fontface = "bold", color = "grey30",
- label.size = 0)+
- # Remove axis labels and add theme
- xlab("Easting") + ylab("Northing") + wlt +
- # Add grid
- scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
-)
-
-# Prepare insets
-(pc.i1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
- ylim = c(rects[[1]]$y1, rects[[1]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-(pc.i2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
- ylim = c(rects[[2]]$y1, rects[[2]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-pcf <- pc +
- annotate(
- "segment",
- x = c(rects[[1]]$x2, 500),
- y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- xend = c(1600, rects[[2]]$x1),
- yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- lineend = "round",
- colour = "grey20",
- size = 0.3
- ) +
- annotation_custom(
- grob = ggplotGrob(pc.i1),
- xmin = 1400,
- xmax = 4100,
- ymin = 3200,
- ymax = 1200) +
- annotation_custom(
- grob = ggplotGrob(pc.i2),
- xmin = -2800,
- xmax = 1000,
- ymin = -4000,
- ymax = -150)
-
-# ggsave(paste0("figures/summap_lgcp_current.jpg"), pcf,
-# width = 16, height = 18, units = "cm")
-
-##### SSP1 ----
-(ps1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(-3239.984, 4510.636),
- ylim = c(-4614.575, 4596.965),
- datum = st_crs(base),
- expand = F,
- label_axes = list(
- top = "E",
- left = "",
- top = ""
- )) +
- # Draw rectangles
- geom_rect(data = rects[[1]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- geom_rect(data = rects[[2]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- # Add title
- geom_label(aes(label = "B", x = 4000, y = 4100),
- size = 10, fontface = "bold", color = "grey30",
- label.size = 0)+
- # Remove axis labels and add theme
- xlab(NULL) + ylab(NULL) + wlt +
- # Add grid
- scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
-)
-
-# Prepare insets
-(ps1.i1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
- ylim = c(rects[[1]]$y1, rects[[1]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-(ps1.i2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
- ylim = c(rects[[2]]$y1, rects[[2]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-ps1f <- ps1 +
- annotate(
- "segment",
- x = c(rects[[1]]$x2, 500),
- y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- xend = c(1600, rects[[2]]$x1),
- yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- lineend = "round",
- colour = "grey20",
- size = 0.3
- ) +
- annotation_custom(
- grob = ggplotGrob(ps1.i1),
- xmin = 1400,
- xmax = 4100,
- ymin = 3200,
- ymax = 1200) +
- annotation_custom(
- grob = ggplotGrob(ps1.i2),
- xmin = -2800,
- xmax = 1000,
- ymin = -4000,
- ymax = -150)
-
-ps1f.s <- ps1f + theme(legend.position = "none")
-
-# ggsave(paste0("figures/summap_lgcp_ssp1.jpg"), ps1f.s,
-# width = 16, height = 18, units = "cm")
-
-
-
-
-##### SSP2 ----
-(ps2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(-3239.984, 4510.636),
- ylim = c(-4614.575, 4596.965),
- datum = st_crs(base),
- expand = F,
- label_axes = list(
- top = "E",
- left = "",
- top = ""
- )) +
- # Draw rectangles
- geom_rect(data = rects[[1]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- geom_rect(data = rects[[2]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- # Add title
- geom_label(aes(label = "C", x = 4000, y = 4100),
- size = 10, fontface = "bold", color = "grey30",
- label.size = 0)+
- # Remove axis labels and add theme
- xlab(NULL) + ylab(NULL) + wlt +
- # Add grid
- scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
-)
-
-# Prepare insets
-(ps2.i1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
- ylim = c(rects[[1]]$y1, rects[[1]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-(ps2.i2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
- ylim = c(rects[[2]]$y1, rects[[2]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-ps2f <- ps2 +
- annotate(
- "segment",
- x = c(rects[[1]]$x2, 500),
- y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- xend = c(1600, rects[[2]]$x1),
- yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- lineend = "round",
- colour = "grey20",
- size = 0.3
- ) +
- annotation_custom(
- grob = ggplotGrob(ps2.i1),
- xmin = 1400,
- xmax = 4100,
- ymin = 3200,
- ymax = 1200) +
- annotation_custom(
- grob = ggplotGrob(ps2.i2),
- xmin = -2800,
- xmax = 1000,
- ymin = -4000,
- ymax = -150)
-
-ps2f.s <- ps2f + theme(legend.position = "none")
-
-# ggsave(paste0("figures/summap_lgcp_ssp2.jpg"), ps2f.s,
-# width = 16, height = 18, units = "cm")
-
-
-
-
-##### SSP3 ----
-(ps3 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(-3239.984, 4510.636),
- ylim = c(-4614.575, 4596.965),
- datum = st_crs(base),
- expand = F,
- label_axes = list(
- top = "E",
- left = "",
- top = ""
- )) +
- # Draw rectangles
- geom_rect(data = rects[[1]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- geom_rect(data = rects[[2]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- # Add title
- geom_label(aes(label = "D", x = 4000, y = 4100),
- size = 10, fontface = "bold", color = "grey30",
- label.size = 0)+
- # Remove axis labels and add theme
- xlab(NULL) + ylab(NULL) + wlt +
- # Add grid
- scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
-)
-
-# Prepare insets
-(ps3.i1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
- ylim = c(rects[[1]]$y1, rects[[1]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-(ps3.i2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
- ylim = c(rects[[2]]$y1, rects[[2]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-ps3f <- ps3 +
- annotate(
- "segment",
- x = c(rects[[1]]$x2, 500),
- y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- xend = c(1600, rects[[2]]$x1),
- yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- lineend = "round",
- colour = "grey20",
- size = 0.3
- ) +
- annotation_custom(
- grob = ggplotGrob(ps3.i1),
- xmin = 1400,
- xmax = 4100,
- ymin = 3200,
- ymax = 1200) +
- annotation_custom(
- grob = ggplotGrob(ps3.i2),
- xmin = -2800,
- xmax = 1000,
- ymin = -4000,
- ymax = -150)
-
-ps3f.s <- ps3f + theme(legend.position = "none")
-
-# ggsave(paste0("figures/summap_lgcp_ssp3.jpg"), ps3f.s,
-# width = 16, height = 18, units = "cm")
-
-# Save composite ----
-final <- pcf + ps1f + ps2f + ps3f + plot_layout(nrow = 1, guides = "collect") &
- theme(legend.position='bottom')
-
-ggsave(paste0("figures/summap_lgcp_composite_q05v.jpg"), final,
- width = 50, height = 18, units = "cm", quality = 100)
-
-### END
\ No newline at end of file
diff --git a/codes/plot_lgcp_supp.R b/codes/plot_lgcp_supp.R
index f59c91b..3e9d632 100644
--- a/codes/plot_lgcp_supp.R
+++ b/codes/plot_lgcp_supp.R
@@ -1,7 +1,7 @@
#### Modelling of coral reef herbivorous invertebrates ####
## Silas C. Principe - silasprincipe@yahoo.com.br - 2022 ##
-# Plot of LGCP results - all species [Raw data mode - supplementary material]
+# Plot of LGCP results - all species [supplementary material]
# Load needed packages ----
library(ggplot2)
@@ -20,41 +20,335 @@ base <- spTransform(base, CRS(proj))
# Convert to SF
base <- st_as_sf(base)
-# Load results ----
# Define species
-sp <- "trve"
-
-# Load species occurrence data
-occ <- SpatialPoints(read.csv(paste0("data/", sp, "/", sp, "_filt.csv"))[,1:2],
- proj4string = CRS(proj))
-
-# Define model
-m <- 6 # Which model
-type <- "cont" # Which type of prediction (full [int] or contrast [cont])
-
-# Load rasters generated before
-curr <- raster(paste0("results/", sp, "/predictions/", sp, "_mean_m", m, "_", type,"_current.tif"))
-ssp1 <- raster(paste0("results/", sp, "/predictions/", sp, "_mean_m", m, "_", type,"_ssp1.tif"))
-ssp2 <- raster(paste0("results/", sp, "/predictions/", sp, "_mean_m", m, "_", type,"_ssp2.tif"))
-ssp3 <- raster(paste0("results/", sp, "/predictions/", sp, "_mean_m", m, "_", type,"_ssp3.tif"))
-
-# Convert to data.frame
-get.val <- function(x, mode = "normal"){
- temp <- as(x, "SpatialPixelsDataFrame")
- temp <- as.data.frame(temp)
- colnames(temp) <- c("val", "x", "y")
- return(temp)
+species <- c("lyva", "eclu", "trve")
+
+for (sp in species) {
+
+ # Load results ----
+
+ # Load species occurrence data
+ occ <- SpatialPoints(read.csv(paste0("data/", sp, "/", sp, "_filt.csv"))[,1:2],
+ proj4string = CRS(proj))
+
+ # Define model
+ allf <- list.files(paste0("results/", sp, "/predictions/"), full.names = T)
+
+ m <- stringr::str_extract(allf[1], "(?<=m)\\d+")
+
+ # Load rasters generated before
+ curr <- stack(allf[grepl("current", allf)])
+ ssp1 <- stack(allf[grepl("ssp1", allf)])
+ ssp2 <- stack(allf[grepl("ssp2", allf)])
+ ssp3 <- stack(allf[grepl("ssp3", allf)])
+
+ # Convert to data.frame
+ get.val <- function(x, add.col = NULL){
+ temp <- as(x, "SpatialPixelsDataFrame")
+ temp <- as.data.frame(temp)
+ colnames(temp) <- c("val", "x", "y")
+ if (!is.null(add.col)) {
+ temp$group <- add.col
+ }
+ return(temp)
+ }
+
+ # Prepare theme/ploting stuff ----
+ # Guide for legend
+ step.guide <- guide_colorbar(title = "ROR\n(contrast)",
+ show.limits = TRUE,
+ barwidth = unit(0.16, "in"),
+ barheight = unit(1.5, "in"),
+ ticks = F,
+ ticks.colour = "grey20",
+ frame.colour = "grey20",
+ title.position = "top")
+
+ step.guide.int <- guide_colorbar(title = "ROR\n(integral)",
+ show.limits = TRUE,
+ barwidth = unit(0.16, "in"),
+ barheight = unit(1.5, "in"),
+ ticks = F,
+ ticks.colour = "grey20",
+ frame.colour = "grey20",
+ title.position = "top")
+
+ step.guide.sd <- guide_colorbar(title = "ROR\n(contrast SD)",
+ show.limits = TRUE,
+ barwidth = unit(0.16, "in"),
+ barheight = unit(1.5, "in"),
+ ticks = F,
+ ticks.colour = "grey20",
+ frame.colour = "grey20",
+ title.position = "top")
+
+
+ # Themes
+ nlt <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_blank(),
+ axis.title.x.top = element_text(vjust = 2, size = 16),
+ axis.title.y.left = element_text(size = 16),
+ legend.position="none",
+ panel.grid.major = element_line(linetype = 'dashed',
+ colour = "grey70",
+ size = .05),
+ panel.background = element_blank()#,
+ #plot.background = element_rect(color = "grey30", fill = 'white')
+ )
+
+ wlt <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_text(colour = "grey60", size = 12),
+ axis.title.x = element_text(vjust = 2, size = 12, colour = "grey60"),
+ axis.title.y.left = element_text(size = 12, colour = "grey60"),
+ plot.title = element_text(size = 16),
+ panel.background = element_blank(),
+ panel.border = element_rect(fill = NA, color = "grey60"),
+ panel.grid.major = element_line(linetype = 'dashed',
+ colour = "grey70",
+ size = .1),
+ legend.position="right",
+ legend.title.align=0.5,
+ legend.text = element_text(size = 16),
+ legend.title = element_text(size = 16),
+ legend.background = element_rect(fill = "white"),
+ strip.background = element_blank(),
+ strip.text = element_text(size = 14)
+
+ )
+
+ int <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_blank(),
+ axis.title = element_blank(),
+ legend.position="none",
+ panel.grid.major = element_blank(),
+ panel.background = element_blank(),
+ plot.background = element_rect(color = "grey30", fill = 'white'),
+ plot.margin = margin(0.5, 0.5, 0, 0, "pt")
+ )
+
+
+ # Scale of values
+ sca <- function(lims, guide){
+ scale_fill_gradientn(
+ colours = rev(c("#A84C00", "#D97D27", "#F5BD44", "#FFD561", "#FFF291",
+ "#FFFFBF", "#E0F3F8", "#ABD9E9", "#74ADD1", "#4575B4", "#313695")),
+ limits = lims,
+ guide = guide,
+ #labels = c("Low", "", "", "", "High"),
+ na.value = "#381900")
+ }
+
+ sca.sd <- function(lims, guide){
+ scale_fill_distiller(palette = "GnBu", direction = 1,
+ limits = lims, guide = guide)
+ }
+
+
+
+ # Generate plots ----
+ non.cont <- as.data.frame(rbind(
+ get.val(curr[[names(curr)[grepl(paste0("mean_m", m, "_int"), names(curr))]]], "Current"),
+ get.val(ssp1[[names(ssp1)[grepl(paste0("mean_m", m, "_int"), names(ssp1))]]], "SSP1"),
+ get.val(ssp2[[names(ssp2)[grepl(paste0("mean_m", m, "_int"), names(ssp2))]]], "SSP2"),
+ get.val(ssp3[[names(ssp3)[grepl(paste0("mean_m", m, "_int"), names(ssp3))]]], "SSP3")
+ ))
+ non.cont$variant <- "Mean"
+
+ (pint <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = non.cont, aes(x = x, y = y, fill = val)) +
+ sca(c(min(non.cont[,1]), max(non.cont[,1])), step.guide.int) + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ bottom = "E",
+ left = "N"
+ )) +
+ # Remove axis labels and add theme
+ xlab("Easting") + ylab("Northing") + wlt + theme(strip.text.x = element_blank()) +
+ ggtitle("Integral") +
+ # Add grid
+ scale_x_discrete(position = "bottom", breaks = c(-2000, 0, 2000, 4000)) +
+ facet_grid(cols = vars(group), rows = vars(variant))
+ )
+
+ cont <- as.data.frame(rbind(
+ get.val(curr[[names(curr)[grepl(paste0("mean_m", m, "_cont"), names(curr))]]], "Current"),
+ get.val(ssp1[[names(ssp1)[grepl(paste0("mean_m", m, "_cont"), names(ssp1))]]], "SSP1"),
+ get.val(ssp2[[names(ssp2)[grepl(paste0("mean_m", m, "_cont"), names(ssp2))]]], "SSP2"),
+ get.val(ssp3[[names(ssp3)[grepl(paste0("mean_m", m, "_cont"), names(ssp3))]]], "SSP3")
+ ))
+
+ sdr <- as.data.frame(rbind(
+ get.val(curr[[names(curr)[grepl(paste0("sd_m", m, "_cont"), names(curr))]]], "Current"),
+ get.val(ssp1[[names(ssp1)[grepl(paste0("sd_m", m, "_cont"), names(ssp1))]]], "SSP1"),
+ get.val(ssp2[[names(ssp2)[grepl(paste0("sd_m", m, "_cont"), names(ssp2))]]], "SSP2"),
+ get.val(ssp3[[names(ssp3)[grepl(paste0("sd_m", m, "_cont"), names(ssp3))]]], "SSP3")
+ ))
+
+ qhigh <- as.data.frame(rbind(
+ get.val(curr[[names(curr)[grepl(paste0("q0.975_m", m, "_cont"), names(curr))]]], "Current"),
+ get.val(ssp1[[names(ssp1)[grepl(paste0("q0.975_m", m, "_cont"), names(ssp1))]]], "SSP1"),
+ get.val(ssp2[[names(ssp2)[grepl(paste0("q0.975_m", m, "_cont"), names(ssp2))]]], "SSP2"),
+ get.val(ssp3[[names(ssp3)[grepl(paste0("q0.975_m", m, "_cont"), names(ssp3))]]], "SSP3")
+ ))
+
+ qlow <- as.data.frame(rbind(
+ get.val(curr[[names(curr)[grepl(paste0("q0.025_m", m, "_cont"), names(curr))]]], "Current"),
+ get.val(ssp1[[names(ssp1)[grepl(paste0("q0.025_m", m, "_cont"), names(ssp1))]]], "SSP1"),
+ get.val(ssp2[[names(ssp2)[grepl(paste0("q0.025_m", m, "_cont"), names(ssp2))]]], "SSP2"),
+ get.val(ssp3[[names(ssp3)[grepl(paste0("q0.025_m", m, "_cont"), names(ssp3))]]], "SSP3")
+ ))
+
+ cont$variant <- "Mean"
+ sdr$variant <- "SD"
+ qhigh$variant <- "Q0.975"
+ qlow$variant <- "Q0.025"
+
+ fulldata <- data.frame(rbind(cont, qhigh, qlow))
+
+ fulldata$variant <- factor(fulldata$variant, levels = c("Mean", "Q0.025", "Q0.975"))
+
+ # minmax <- range(cont$val[cont$group == "Current"])
+ #
+ # fulldata$val <- (fulldata$val - min(minmax))/(max(minmax) - min(minmax))
+ options(scipen = 999)
+ (pcont <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = fulldata[fulldata$variant == "Mean",], aes(x = x, y = y, fill = val)) +
+ sca(c(min(fulldata[,1]), max(fulldata[,1])), step.guide) + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ bottom = "",
+ left = "N"
+ )) +
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt + theme(legend.position = "none") +
+ ggtitle("Contrast") +
+ # Add grid
+ scale_x_discrete(position = "bottom", breaks = c(-2000, 0, 2000, 4000)) +
+ facet_grid(cols = vars(group), rows = vars(variant))
+ )
+
+ (pcontqlow <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = fulldata[fulldata$variant == "Q0.025",], aes(x = x, y = y, fill = val)) +
+ sca(c(min(fulldata[,1]), max(fulldata[,1])), step.guide) + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ bottom = "",
+ left = "N"
+ )) +
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt + theme(strip.text.x = element_blank()) +
+ #ggtitle("Contrast") +
+ # Add grid
+ scale_x_discrete(position = "bottom", breaks = c(-2000, 0, 2000, 4000)) +
+ facet_grid(cols = vars(group), rows = vars(variant))
+ )
+
+
+ (pcontqhigh <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = fulldata[fulldata$variant == "Q0.975",], aes(x = x, y = y, fill = val)) +
+ sca(c(min(fulldata[,1]), max(fulldata[,1])), step.guide) + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ bottom = "",
+ left = "N"
+ )) +
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt + theme(strip.text.x = element_blank()) + theme(legend.position = "none") +
+ #ggtitle("Contrast") +
+ # Add grid
+ scale_x_discrete(position = "bottom", breaks = c(-2000, 0, 2000, 4000)) +
+ facet_grid(cols = vars(group), rows = vars(variant))
+ )
+
+ (pcontsd <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = sdr, aes(x = x, y = y, fill = val)) +
+ sca.sd(c(min(sdr[,1]), max(sdr[,1])), step.guide.sd) + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ bottom = "",
+ left = "N"
+ )) +
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ theme(strip.text.x = element_blank(),
+ legend.text = element_text(size = 12),
+ legend.title = element_text(size = 12)) +
+ #ggtitle("Contrast") +
+ # Add grid
+ scale_x_discrete(position = "bottom", breaks = c(-2000, 0, 2000, 4000)) +
+ facet_grid(cols = vars(group), rows = vars(variant))
+ )
+
+
+ # Save composite ----
+ final <- pcont + pcontqlow + pcontqhigh + pcontsd + pint + plot_layout(ncol = 1)# &
+ # theme(legend.position='bottom')
+
+ ggsave(paste0("figures/", sp, "_lgcp_supp_comp_m", m, ".jpg"), final,
+ width = 25, height = 30, units = "cm", quality = 100)
+
}
-curr.v <- get.val(curr)
-ssp1.v <- get.val(ssp1)
-ssp2.v <- get.val(ssp2)
-ssp3.v <- get.val(ssp3)
-# Prepare theme/ploting stuff ----
-# Guide for legend
-step.guide <- guide_colorbar(title = "Relative occurrence rate",
+# Plot spatial component -----
+step.guide <- guide_colorbar(title = "Spatial component effect",
show.limits = TRUE,
barheight = unit(0.12, "in"),
barwidth = unit(3.5, "in"),
@@ -63,502 +357,72 @@ step.guide <- guide_colorbar(title = "Relative occurrence rate",
frame.colour = "grey20",
title.position = "top")
-
-# Themes
-nlt <- theme_classic()+
- theme(axis.line = element_blank(),
- axis.ticks = element_blank(),
- axis.text = element_blank(),
- axis.title.x.top = element_text(vjust = 2, size = 16),
- axis.title.y.left = element_text(size = 16),
- legend.position="none",
- panel.grid.major = element_line(linetype = 'dashed',
- colour = "grey70",
- size = .05),
- panel.background = element_blank()#,
- #plot.background = element_rect(color = "grey30", fill = 'white')
- )
-
-wlt <- theme_classic()+
- theme(axis.line = element_blank(),
- axis.ticks = element_blank(),
- axis.text = element_text(colour = "grey60", size = 14),
- axis.title.x.top = element_text(vjust = 2, size = 16),
- axis.title.y.left = element_text(size = 16),
- panel.background = element_blank(),
- panel.border = element_rect(fill = NA, color = "grey60"),
- panel.grid.major = element_line(linetype = 'dashed',
- colour = "grey70",
- size = .1),
- legend.position="bottom",
- legend.title.align=0.5,
- legend.text = element_text(size = 16),
- legend.title = element_text(size = 16),
- legend.background = element_rect(fill = "white"),
-
- )
-
-int <- theme_classic()+
- theme(axis.line = element_blank(),
- axis.ticks = element_blank(),
- axis.text = element_blank(),
- axis.title = element_blank(),
- legend.position="none",
- panel.grid.major = element_blank(),
- panel.background = element_blank(),
- plot.background = element_rect(color = "grey30", fill = 'white'),
- plot.margin = margin(0.5, 0.5, 0, 0, "pt")
- )
-
-
-# Scale of values
-sca <- scale_fill_gradientn(
- colours = rev(c("#A84C00", "#D97D27", "#F5BD44", "#FFD561", "#FFF291",
- "#FFFFBF", "#E0F3F8", "#ABD9E9", "#74ADD1", "#4575B4", "#313695")),
- limits = c(0,
- max(c(
- curr.v$val,
- ssp1.v$val,
- ssp2.v$val,
- ssp3.v$val
- ))),
- guide = step.guide,
- #labels = c("Low", "", "", "", "High"),
- na.value = "#381900")
-
-
-
-# Generate plots ----
-##### Current ----
-# Rectangles to highlight
-rects <- list(data.frame(x1 = -1600, x2 = -100, y1 = 2300, y2= 3300, label = "a"),
- data.frame(x1 = 2511, x2 = 4000, y1 = -1800, y2= -2808, label = "b"))
-
-(pc <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Add occurrence points
- # geom_point(data = data.frame(occ@coords),
- # aes(x = decimalLongitude, y = decimalLatitude), size = 1,
- # alpha = .2, shape = 16)+
- # Establish area
- coord_sf(xlim = c(-3239.984, 4510.636),
- ylim = c(-4614.575, 4596.965),
- datum = st_crs(base),
- expand = F,
- label_axes = list(
- top = "E",
- left = "N",
- top = ""
- )) +
- # Draw rectangles
- geom_rect(data = rects[[1]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- geom_rect(data = rects[[2]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- # Add title
- geom_label(aes(label = "A", x = 4000, y = 4100),
- size = 10, fontface = "bold", color = "grey30",
- label.size = 0)+
- # Remove axis labels and add theme
- xlab("Easting") + ylab("Northing") + wlt +
- # Add grid
- scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
-)
-
-# Prepare insets
-(pc.i1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
- ylim = c(rects[[1]]$y1, rects[[1]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-(pc.i2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
- ylim = c(rects[[2]]$y1, rects[[2]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-pcf <- pc +
- annotate(
- "segment",
- x = c(rects[[1]]$x2, 500),
- y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- xend = c(1600, rects[[2]]$x1),
- yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- lineend = "round",
- colour = "grey20",
- size = 0.3
- ) +
- annotation_custom(
- grob = ggplotGrob(pc.i1),
- xmin = 1400,
- xmax = 4100,
- ymin = 3200,
- ymax = 1200) +
- annotation_custom(
- grob = ggplotGrob(pc.i2),
- xmin = -2500,
- xmax = 1000,
- ymin = -3100,
- ymax = -900)
-
-
-# ggsave(paste0("figures/", sp, "_lgcp_supp_current_m", m, "_", type, ".jpg"), pcf,
-# width = 16, height = 18, units = "cm")
-
-
-
-##### SSP1 ----
-(ps1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(-3239.984, 4510.636),
- ylim = c(-4614.575, 4596.965),
- datum = st_crs(base),
- expand = F,
- label_axes = list(
- top = "E",
- left = "",
- top = ""
- )) +
- # Draw rectangles
- geom_rect(data = rects[[1]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- geom_rect(data = rects[[2]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- # Add title
- geom_label(aes(label = "B", x = 4000, y = 4100),
- size = 10, fontface = "bold", color = "grey30",
- label.size = 0)+
- # Remove axis labels and add theme
- xlab(NULL) + ylab(NULL) + wlt +
- # Add grid
- scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
-)
-
-# Prepare insets
-(ps1.i1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
- ylim = c(rects[[1]]$y1, rects[[1]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-(ps1.i2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
- ylim = c(rects[[2]]$y1, rects[[2]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-ps1f <- ps1 +
- annotate(
- "segment",
- x = c(rects[[1]]$x2, 500),
- y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- xend = c(1600, rects[[2]]$x1),
- yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- lineend = "round",
- colour = "grey20",
- size = 0.3
- ) +
- annotation_custom(
- grob = ggplotGrob(ps1.i1),
- xmin = 1400,
- xmax = 4100,
- ymin = 3200,
- ymax = 1200) +
- annotation_custom(
- grob = ggplotGrob(ps1.i2),
- xmin = -2500,
- xmax = 1000,
- ymin = -3100,
- ymax = -900)
-
-ps1f.s <- ps1f + theme(legend.position = "none")
-
-# ggsave(paste0("figures/", sp, "_lgcp_supp_ssp1_m", m, "_", type, ".jpg"), ps1f.s,
-# width = 16, height = 18, units = "cm")
-
-
-
-
-##### SSP2 ----
-(ps2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(-3239.984, 4510.636),
- ylim = c(-4614.575, 4596.965),
- datum = st_crs(base),
- expand = F,
- label_axes = list(
- top = "E",
- left = "",
- top = ""
- )) +
- # Draw rectangles
- geom_rect(data = rects[[1]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- geom_rect(data = rects[[2]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- # Add title
- geom_label(aes(label = "C", x = 4000, y = 4100),
- size = 10, fontface = "bold", color = "grey30",
- label.size = 0)+
- # Remove axis labels and add theme
- xlab(NULL) + ylab(NULL) + wlt +
- # Add grid
- scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
-)
-
-# Prepare insets
-(ps2.i1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
- ylim = c(rects[[1]]$y1, rects[[1]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-(ps2.i2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
- ylim = c(rects[[2]]$y1, rects[[2]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-ps2f <- ps2 +
- annotate(
- "segment",
- x = c(rects[[1]]$x2, 500),
- y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- xend = c(1600, rects[[2]]$x1),
- yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- lineend = "round",
- colour = "grey20",
- size = 0.3
- ) +
- annotation_custom(
- grob = ggplotGrob(ps2.i1),
- xmin = 1400,
- xmax = 4100,
- ymin = 3200,
- ymax = 1200) +
- annotation_custom(
- grob = ggplotGrob(ps2.i2),
- xmin = -2500,
- xmax = 1000,
- ymin = -3100,
- ymax = -900)
-
-ps2f.s <- ps2f + theme(legend.position = "none")
-
-# ggsave(paste0("figures/", sp, "_lgcp_supp_ssp2_m", m, "_", type, ".jpg"), ps2f.s,
-# width = 16, height = 18, units = "cm")
-
-
+sca <- function(lims, guide){
+ scale_fill_gradientn(
+ colours = rev(c("#A84C00", "#D97D27", "#F5BD44", "#FFD561", "#FFF291",
+ "#FFFFBF", "#E0F3F8", "#ABD9E9", "#74ADD1", "#4575B4", "#313695")),
+ limits = lims,
+ breaks = seq(round(min(lims)), round(max(lims)), by = 0.5),
+ guide = guide,
+ #labels = c("Low", "", "", "", "High"),
+ na.value = "#381900")
+}
-##### SSP3 ----
-(ps3 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(-3239.984, 4510.636),
- ylim = c(-4614.575, 4596.965),
- datum = st_crs(base),
- expand = F,
- label_axes = list(
- top = "E",
- left = "",
- top = ""
- )) +
- # Draw rectangles
- geom_rect(data = rects[[1]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- geom_rect(data = rects[[2]],
- aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
- fill = NA, color = "grey20", size = .3)+
- # geom_text(data = rects[[1]],
- # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
- # Add title
- geom_label(aes(label = "D", x = 4000, y = 4100),
- size = 10, fontface = "bold", color = "grey30",
- label.size = 0)+
- # Remove axis labels and add theme
- xlab(NULL) + ylab(NULL) + wlt +
- # Add grid
- scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+# Load spatial component
+allf <- list.files("results", full.names = T, recursive = T)
+allf <- allf[grepl("spatial_mean", allf)]
+
+spatcomp <- stack(allf)
+
+spatcomp.data <- data.frame(rbind(
+ get.val(spatcomp$lyva_m4_spatial_mean_effect, "Lytechinus variegatus"),
+ get.val(spatcomp$eclu_m4_spatial_mean_effect, "Echinometra lucunter"),
+ get.val(spatcomp$trve_m6_spatial_mean_effect, "Tripneustes ventricosus")
+))
+
+spatcomp.data$group <- factor(spatcomp.data$group,
+ levels = c("Lytechinus variegatus", "Echinometra lucunter", "Tripneustes ventricosus"))
+
+species.pts <- lapply(species, function(sp){
+ occ <- SpatialPoints(read.csv(paste0("data/", sp, "/", sp, "_filt.csv"))[,1:2],
+ proj4string = CRS(proj))
+ occ <- sf::st_as_sf(occ)
+ occ$group <- ifelse(sp == "lyva", "Lytechinus variegatus",
+ ifelse(sp == "eclu", "Echinometra lucunter", "Tripneustes ventricosus"))
+ occ
+})
+species.pts <- do.call("rbind", species.pts)
+
+(pspat <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = spatcomp.data, aes(x = x, y = y, fill = val)) +
+ sca(c(min(spatcomp.data[,1]), max(spatcomp.data[,1])), step.guide) + # Add color scale
+ geom_sf(data = species.pts, size = .4, alpha = .2) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ bottom = "",
+ left = "N"
+ )) +
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt + theme(legend.position = "bottom",
+ legend.text = element_text(size = 9),
+ legend.title = element_text(size = 11),
+ strip.text = element_text(size = 14, face = "italic")) +
+ #ggtitle("Contrast") +
+ # Add grid
+ scale_x_discrete(position = "bottom", breaks = c(-2000, 0, 2000, 4000)) +
+ facet_grid(cols = vars(group))
)
-# Prepare insets
-(ps3.i1 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
- ylim = c(rects[[1]]$y1, rects[[1]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-(ps3.i2 <- ggplot()+
- # Base maps
- geom_sf(data = base,
- color = c("#CFCFCF"),
- size = 0.6,
- fill = "white") +
- # Get the raster
- geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
- sca + # Add color scale
- # Establish area
- coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
- ylim = c(rects[[2]]$y1, rects[[2]]$y2),
- datum = st_crs(base),
- expand = F) + int)
-
-ps3f <- ps3 +
- annotate(
- "segment",
- x = c(rects[[1]]$x2, 500),
- y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- xend = c(1600, rects[[2]]$x1),
- yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
- (rects[[2]]$y1+rects[[2]]$y2)/2),
- lineend = "round",
- colour = "grey20",
- size = 0.3
- ) +
- annotation_custom(
- grob = ggplotGrob(ps3.i1),
- xmin = 1400,
- xmax = 4100,
- ymin = 3200,
- ymax = 1200) +
- annotation_custom(
- grob = ggplotGrob(ps3.i2),
- xmin = -2500,
- xmax = 1000,
- ymin = -3100,
- ymax = -900)
-
-ps3f.s <- ps3f + theme(legend.position = "none")
-
-# ggsave(paste0("figures/", sp, "_lgcp_supp_ssp3_m", m, "_", type, ".jpg"), ps3f.s,
-# width = 16, height = 18, units = "cm")
-
-# Save composite ----
-final <- pcf + ps1f + ps2f + ps3f + plot_layout(nrow = 1, guides = "collect") &
- theme(legend.position='bottom')
-
-ggsave(paste0("figures/", sp, "_lgcp_supp_comp_m", m, "_", type, ".jpg"), final,
- width = 50, height = 18, units = "cm", quality = 100)
+ggsave(paste0("figures/lgcp_supp_spatial.jpg"), pspat,
+ width = 27, height = 14, units = "cm", quality = 100)
diff --git a/codes/plot_lgcp_threshextrap.R b/codes/plot_lgcp_threshextrap.R
new file mode 100644
index 0000000..ee32a87
--- /dev/null
+++ b/codes/plot_lgcp_threshextrap.R
@@ -0,0 +1,1143 @@
+#### Modelling of coral reef herbivorous invertebrates ####
+## Silas C. Principe - silasprincipe@yahoo.com.br - 2022 ##
+
+# Plot of the summed map (i.e. aggregating the results of all species)
+
+# Load needed packages ----
+library(ggplot2)
+library(sf)
+library(raster)
+library(patchwork)
+
+# Load base shapefiles ----
+base <- shapefile("gis/basemaps/ne_110m_land_edited.shp")
+# Crop to the extent
+base <- buffer(base, 0)
+base <- crop(base, extent(-120, -10, -55, 65))
+# Reproject
+proj <- "+proj=laea +lat_0=0 +lon_0=-70 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs"
+base <- spTransform(base, CRS(proj))
+# Convert to SF
+base <- st_as_sf(base)
+
+# Calculate results ----
+species <- c("lyva", "eclu", "trve")
+
+# Load raster [new version]
+scen.rasts <- lapply(species, function(x){
+
+ all.rast <- lapply(c("current", paste0("ssp", 1:3)), function(z){
+ # Open files
+ self <- list.files(paste0("results/", x, "/predictions/"),
+ pattern = "mean", full.names = T)
+ self <- self[grep(paste0("cont_", z), self)]
+ r <- raster(self)
+ return(r)
+ })
+
+ all.rast <- stack(all.rast)
+
+ # Load occurrence data
+ proj <- "+proj=laea +lat_0=0 +lon_0=-70 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs"
+ occ <- SpatialPoints(read.csv(paste0("data/", x, "/", x, "_filt.csv"))[,1:2],
+ proj4string = CRS(proj))
+
+ ### Threhsolding
+ get.thresh <- function(res, pts){
+ vals <- raster::extract(res, pts)
+ p10 <- ceiling(length(vals) * 0.9)
+ thresh <- rev(sort(vals))[p10]
+
+ res[res < thresh] <- NA
+
+ secvals <- raster::extract(res, pts)
+ secvals <- secvals[!is.na(secvals)]
+ secthresh <- quantile(secvals, 0.5)
+
+ return(c(thresh, secthresh))
+ }
+
+ threshs <- get.thresh(all.rast[[1]], occ)
+
+ classify <- function(scen, threshold){
+ scen[scen < threshold] <- 0
+ scen[scen >= threshold] <- 1
+ return(scen)
+ }
+
+ for (i in 1:4) {
+ all.rast[[i]] <- classify(all.rast[[i]], threshs[1])
+ }
+
+ names(all.rast) <- paste(x, c("current", paste0("ssp", 1:3)), sep = "_")
+
+ return(all.rast)
+
+})
+
+
+# Load raster [new version]
+extrap.rasts <- lapply(species, function(x){
+
+ all.rast <- lapply(c("current", paste0("ssp", 1:3)), function(z){
+ # Open files
+ self <- list.files(paste0("results/", x, "/predictions/"),
+ pattern = "mean", full.names = T)
+ self <- self[grep(paste0("cont_", z), self)]
+ r <- raster(self)
+ return(r)
+ })
+
+ all.rast <- stack(all.rast)
+
+ # Load occurrence data
+ proj <- "+proj=laea +lat_0=0 +lon_0=-70 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs"
+ occ <- SpatialPoints(read.csv(paste0("data/", x, "/", x, "_filt.csv"))[,1:2],
+ proj4string = CRS(proj))
+
+ threshs <- maxValue(all.rast[[1]])
+
+ classify <- function(scen, threshold){
+ scen[scen <= threshold] <- 0
+ scen[scen > threshold] <- 1
+ return(scen)
+ }
+
+ for (i in 1:4) {
+ all.rast[[i]] <- classify(all.rast[[i]], threshs[1])
+ }
+
+ names(all.rast) <- paste(x, c("current", paste0("ssp", 1:3)), sep = "_")
+
+ return(all.rast)
+
+})
+
+
+
+sum.rasts <- scen.rasts[[1]] + scen.rasts[[2]] + scen.rasts[[3]]
+
+curr <- sum.rasts[[1]]
+ssp1 <- sum.rasts[[2]]
+ssp2 <- sum.rasts[[3]]
+ssp3 <- sum.rasts[[4]]
+
+# Convert to data.frame
+get.val <- function(x){
+ temp <- as(x, "SpatialPixelsDataFrame")
+ temp <- as.data.frame(temp)
+ colnames(temp) <- c("val", "x", "y")
+ temp$val <- as.factor(temp$val)
+ return(temp)
+}
+
+curr.v <- get.val(curr)
+ssp1.v <- get.val(ssp1)
+ssp2.v <- get.val(ssp2)
+ssp3.v <- get.val(ssp3)
+
+
+
+# Prepare theme/ploting stuff ----
+# Guide for legend
+step.guide <- guide_legend(title = "Number of species",
+ show.limits = TRUE,
+ keyheight = unit(0.2, "in"),
+ keywidth = unit(0.7, "in"),
+ ticks = T,
+ ticks.colour = "grey20",
+ frame.colour = "grey20",
+ title.position = "top",
+ title.hjust = 0.5,
+ label.position = "bottom",
+ label.hjust = 0.5)
+
+nlt <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_blank(),
+ axis.title.x.top = element_text(vjust = 2, size = 16),
+ axis.title.y.left = element_text(size = 16),
+ legend.position="none",
+ panel.grid.major = element_line(linetype = 'dashed',
+ colour = "grey70",
+ size = .05),
+ panel.background = element_blank()#,
+ #plot.background = element_rect(color = "grey30", fill = 'white')
+ )
+
+wlt <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_text(colour = "grey60", size = 14),
+ axis.title.x.top = element_text(vjust = 2, size = 16),
+ axis.title.y.left = element_text(size = 16),
+ panel.background = element_blank(),
+ panel.border = element_rect(fill = NA, color = "grey60"),
+ panel.grid.major = element_line(linetype = 'dashed',
+ colour = "grey70",
+ size = .1),
+ legend.position="bottom",
+ legend.title.align=0.5,
+ legend.text = element_text(size = 14),
+ legend.title = element_text(size = 16),
+ legend.background = element_rect(fill = "white"),
+ legend.spacing.x = unit(0.001, 'cm')
+ )
+
+int <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_blank(),
+ axis.title = element_blank(),
+ legend.position="none",
+ panel.grid.major = element_blank(),
+ panel.background = element_blank(),
+ plot.background = element_rect(color = "grey30", fill = 'white'),
+ plot.margin = margin(0.5, 0.5, 0, 0, "pt")
+ )
+
+sca <- scale_fill_manual(values = c("#E9E7E7",
+ RColorBrewer::brewer.pal(n = 4, "YlGnBu")[2:4]),
+ guide = step.guide)
+
+
+# Generate plots ----
+##### Current ----
+# Rectangles to highlight
+rects <- list(data.frame(x1 = -1200, x2 = -50, y1 = 2100, y2= 3100, label = "a"),
+ data.frame(x1 = 2450, x2 = 3800, y1 = -1800, y2= -2900, label = "b"))
+
+(pc <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Add occurrence points
+ # geom_point(data = data.frame(occ@coords),
+ # aes(x = decimalLongitude, y = decimalLatitude), size = 1,
+ # alpha = .2, shape = 16)+
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "N",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "A", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab("Easting") + ylab("Northing") + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+)
+
+# Prepare insets
+(pc.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+(pc.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+pcf <- pc +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(pc.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(pc.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+# ggsave(paste0("figures/summap_lgcp_current.jpg"), pcf,
+# width = 16, height = 18, units = "cm")
+
+##### SSP1 ----
+(ps1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "B", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+)
+
+# Prepare insets
+(ps1.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+(ps1.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ps1f <- ps1 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps1.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps1.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ps1f.s <- ps1f + theme(legend.position = "none")
+
+# ggsave(paste0("figures/summap_lgcp_ssp1.jpg"), ps1f.s,
+# width = 16, height = 18, units = "cm")
+
+
+
+
+##### SSP2 ----
+(ps2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "C", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+)
+
+# Prepare insets
+(ps2.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+(ps2.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ps2f <- ps2 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps2.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps2.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ps2f.s <- ps2f + theme(legend.position = "none")
+
+# ggsave(paste0("figures/summap_lgcp_ssp2.jpg"), ps2f.s,
+# width = 16, height = 18, units = "cm")
+
+
+
+
+##### SSP3 ----
+(ps3 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "D", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+)
+
+# Prepare insets
+(ps3.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+(ps3.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ps3f <- ps3 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps3.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps3.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ps3f.s <- ps3f + theme(legend.position = "none")
+
+# ggsave(paste0("figures/summap_lgcp_ssp3.jpg"), ps3f.s,
+# width = 16, height = 18, units = "cm")
+
+# Save composite ----
+final <- pcf + ps1f + ps2f + ps3f + plot_layout(nrow = 1, guides = "collect") &
+ theme(legend.position='bottom')
+
+ggsave(paste0("figures/summap_lgcp_composite.jpg"), final,
+ width = 50, height = 18, units = "cm", quality = 100)
+
+
+## Q0.5 quantile version ----
+
+# Load raster [new version]
+scen.rasts <- lapply(species, function(x){
+
+ all.rast <- lapply(c("current", paste0("ssp", 1:3)), function(z){
+ # Open files
+ self <- list.files(paste0("results/", x, "/predictions/"),
+ pattern = "mean", full.names = T)
+ self <- self[grep(paste0("cont_", z), self)]
+ r <- raster(self)
+ return(r)
+ })
+
+ all.rast <- stack(all.rast)
+
+ # Load occurrence data
+ proj <- "+proj=laea +lat_0=0 +lon_0=-70 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs"
+ occ <- SpatialPoints(read.csv(paste0("data/", x, "/", x, "_filt.csv"))[,1:2],
+ proj4string = CRS(proj))
+
+ ### Threhsolding
+ get.thresh <- function(res, pts){
+ vals <- raster::extract(res, pts)
+ p10 <- ceiling(length(vals) * 0.9)
+ thresh <- rev(sort(vals))[p10]
+
+ res[res < thresh] <- NA
+
+ secvals <- raster::extract(res, pts)
+ secvals <- secvals[!is.na(secvals)]
+ secthresh <- quantile(secvals, 0.5)
+
+ return(c(thresh, secthresh))
+ }
+
+ threshs <- get.thresh(all.rast[[1]], occ)
+
+ classify <- function(scen, threshold){
+ scen[scen < threshold] <- 0
+ scen[scen >= threshold] <- 1
+ return(scen)
+ }
+
+ for (i in 1:4) {
+ all.rast[[i]] <- classify(all.rast[[i]], threshs[2])
+ }
+
+ names(all.rast) <- paste(x, c("current", paste0("ssp", 1:3)), sep = "_")
+
+ return(all.rast)
+
+})
+
+
+
+sum.rasts <- scen.rasts[[1]] + scen.rasts[[2]] + scen.rasts[[3]]
+
+curr <- sum.rasts[[1]]
+ssp1 <- sum.rasts[[2]]
+ssp2 <- sum.rasts[[3]]
+ssp3 <- sum.rasts[[4]]
+
+# Convert to data.frame
+get.val <- function(x){
+ temp <- as(x, "SpatialPixelsDataFrame")
+ temp <- as.data.frame(temp)
+ colnames(temp) <- c("val", "x", "y")
+ temp$val <- as.factor(temp$val)
+ return(temp)
+}
+
+curr.v <- get.val(curr)
+ssp1.v <- get.val(ssp1)
+ssp2.v <- get.val(ssp2)
+ssp3.v <- get.val(ssp3)
+
+## Plot maps
+
+(pc <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Add occurrence points
+ # geom_point(data = data.frame(occ@coords),
+ # aes(x = decimalLongitude, y = decimalLatitude), size = 1,
+ # alpha = .2, shape = 16)+
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "N",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "A", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab("Easting") + ylab("Northing") + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+)
+
+# Prepare insets
+(pc.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+(pc.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = curr.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+pcf <- pc +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(pc.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(pc.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+# ggsave(paste0("figures/summap_lgcp_current.jpg"), pcf,
+# width = 16, height = 18, units = "cm")
+
+##### SSP1 ----
+(ps1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "B", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+)
+
+# Prepare insets
+(ps1.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+(ps1.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp1.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ps1f <- ps1 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps1.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps1.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ps1f.s <- ps1f + theme(legend.position = "none")
+
+# ggsave(paste0("figures/summap_lgcp_ssp1.jpg"), ps1f.s,
+# width = 16, height = 18, units = "cm")
+
+
+
+
+##### SSP2 ----
+(ps2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "C", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+)
+
+# Prepare insets
+(ps2.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+(ps2.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp2.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ps2f <- ps2 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps2.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps2.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ps2f.s <- ps2f + theme(legend.position = "none")
+
+# ggsave(paste0("figures/summap_lgcp_ssp2.jpg"), ps2f.s,
+# width = 16, height = 18, units = "cm")
+
+
+
+
+##### SSP3 ----
+(ps3 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Draw rectangles
+ geom_rect(data = rects[[1]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ geom_rect(data = rects[[2]],
+ aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2),
+ fill = NA, color = "grey20", size = .3)+
+ # geom_text(data = rects[[1]],
+ # aes(x = (x2 - 100), y = (y2 - 100), label = label))+
+ # Add title
+ geom_label(aes(label = "D", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+)
+
+# Prepare insets
+(ps3.i1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[1]]$x1, rects[[1]]$x2),
+ ylim = c(rects[[1]]$y1, rects[[1]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+(ps3.i2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = ssp3.v, aes(x = x, y = y, fill = val)) +
+ sca + # Add color scale
+ # Establish area
+ coord_sf(xlim = c(rects[[2]]$x1, rects[[2]]$x2),
+ ylim = c(rects[[2]]$y1, rects[[2]]$y2),
+ datum = st_crs(base),
+ expand = F) + int)
+
+ps3f <- ps3 +
+ annotate(
+ "segment",
+ x = c(rects[[1]]$x2, 500),
+ y = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ xend = c(1600, rects[[2]]$x1),
+ yend = c((rects[[1]]$y1+rects[[1]]$y2)/2,
+ (rects[[2]]$y1+rects[[2]]$y2)/2),
+ lineend = "round",
+ colour = "grey20",
+ size = 0.3
+ ) +
+ annotation_custom(
+ grob = ggplotGrob(ps3.i1),
+ xmin = 1400,
+ xmax = 4100,
+ ymin = 3200,
+ ymax = 1200) +
+ annotation_custom(
+ grob = ggplotGrob(ps3.i2),
+ xmin = -2800,
+ xmax = 1000,
+ ymin = -4000,
+ ymax = -150)
+
+ps3f.s <- ps3f + theme(legend.position = "none")
+
+# ggsave(paste0("figures/summap_lgcp_ssp3.jpg"), ps3f.s,
+# width = 16, height = 18, units = "cm")
+
+# Save composite ----
+final <- pcf + ps1f + ps2f + ps3f + plot_layout(nrow = 1, guides = "collect") &
+ theme(legend.position='bottom')
+
+ggsave(paste0("figures/summap_lgcp_composite_q05v.jpg"), final,
+ width = 50, height = 18, units = "cm", quality = 100)
+
+### END
\ No newline at end of file
diff --git a/codes/plot_mess_temp.R b/codes/plot_mess_temp.R
new file mode 100644
index 0000000..f8f1559
--- /dev/null
+++ b/codes/plot_mess_temp.R
@@ -0,0 +1,612 @@
+#### Modelling of coral reef herbivorous invertebrates ####
+## Silas C. Principe - silasprincipe@yahoo.com.br - 2022 ##
+
+# Plot of the MESS maps and difference in temperature
+
+# Load needed packages ----
+library(ecospat)
+library(inlabru)
+library(ggplot2)
+library(sf)
+library(raster)
+library(patchwork)
+
+# Set species
+species <- c("lyva", "eclu", "trve")
+
+# Load quadrature points
+list2env(readRDS('data/lgcp_data.rds'),globalenv())
+
+ips <- ipoints(starea, mesh)
+
+# Load environmental data
+env <- stack(list.files("data/env/ready_layers", pattern = "_cur", full.names = T))
+r12 <- stack(list.files("data/env/ready_layers", pattern = "_r12", full.names = T))
+r24 <- stack(list.files("data/env/ready_layers", pattern = "_r24", full.names = T))
+r37 <- stack(list.files("data/env/ready_layers", pattern = "_r37", full.names = T))
+
+# Include the distance to coast layer
+env <- stack(env, raster("data/env/ready_layers/distcoast.tif"))
+r12[[8]] <- r24[[8]] <- r37[[8]] <- env[[8]]
+
+# Change names
+names(env) <- c("chl", "coldm", "ph", "pho", "sal", "sst", "warmm", "dist")
+names(r12) <- names(r24) <- names(r37) <- names(env)
+
+# Load non-scaled SST
+env.temp <- stack("data/env/crop_layers/BO21_tempmean_ss.tif",
+ "data/env/bioclim_layers/mtemp_coldm_current_hr.tif")
+r12.temp <- stack("data/env/proj_layers/ssp126/BO21_tempmean_ss.tif",
+ "data/env/bioclim_layers/mtemp_coldm_ssp126_hr.tif")
+r24.temp <- stack("data/env/proj_layers/ssp245/BO21_tempmean_ss.tif",
+ "data/env/bioclim_layers/mtemp_coldm_ssp245_hr.tif")
+r37.temp <- stack("data/env/proj_layers/ssp370/BO21_tempmean_ss.tif",
+ "data/env/bioclim_layers/mtemp_coldm_ssp370_hr.tif")
+
+names(env.temp) <- names(r12.temp) <- names(r24.temp) <- names(r37.temp) <- c("sst", "coldm")
+
+env.temp <- mask(env.temp, env.temp[[1]])
+r12.temp <- mask(r12.temp, r12.temp[[1]])
+r24.temp <- mask(r24.temp, r24.temp[[1]])
+r37.temp <- mask(r37.temp, r37.temp[[1]])
+
+env.temp <- projectRaster(env.temp, crs = crs(env))
+r12.temp <- projectRaster(r12.temp, crs = crs(env))
+r24.temp <- projectRaster(r24.temp, crs = crs(env))
+r37.temp <- projectRaster(r37.temp, crs = crs(env))
+
+r12.temp.delta <- r12.temp - env.temp
+r24.temp.delta <- r24.temp - env.temp
+r37.temp.delta <- r37.temp - env.temp
+
+r12.temp.delta <- rasterToPoints(r12.temp.delta)
+r24.temp.delta <- rasterToPoints(r24.temp.delta)
+r37.temp.delta <- rasterToPoints(r37.temp.delta)
+
+env.temp <- rasterToPoints(env.temp)
+
+# Set layers used in each model
+layers <- list(
+ c("sal", "dist", "sst", "ph"),
+ c("sal", "dist", "coldm", "ph"),
+ c("sal", "dist", "coldm", "ph", "chl", "pho")
+)
+
+# Set function to get data for integration points using IDW
+getd <- function(rast, ip){
+ library(gstat)
+ rast <- extend(rast, (extent(min(mesh$loc[,1]),
+ max(mesh$loc[,1]),
+ min(mesh$loc[,2]),
+ max(mesh$loc[,2])))+
+ c(-200, 200, -200, 200))
+
+ epts <- raster::extract(rast, ip)
+ epts <- data.frame(epts, coordinates(ip))
+
+ tofill <- epts[is.na(epts[,1]),]
+
+ epts <- data.frame(rasterToPoints(rast))
+
+ coordinates(epts) <- ~x+y
+ coordinates(tofill) <- ~x+y
+
+ for (i in 1:nlayers(rast)) {
+
+ mod <- gstat(formula = as.formula(paste(names(epts)[i],"~ 1")),
+ data = epts, nmax = 12)
+
+ pred <- predict(mod, tofill)
+
+ rast[[i]][cellFromXY(rast[[i]], coordinates(tofill))] <- pred$var1.pred
+ }
+
+ rast
+}
+
+env <- getd(env, ip = ips)
+r12 <- getd(r12, ip = ips)
+r24 <- getd(r24, ip = ips)
+r37 <- getd(r37, ip = ips)
+
+# Load base shapefiles ----
+base <- shapefile("gis/basemaps/ne_110m_land_edited.shp")
+# Crop to the extent
+base <- buffer(base, 0)
+base <- crop(base, extent(-120, -10, -55, 65))
+# Reproject
+proj <- "+proj=laea +lat_0=0 +lon_0=-70 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs"
+base <- spTransform(base, CRS(proj))
+# Convert to SF
+base <- st_as_sf(base)
+
+base.env <- stack(list.files("data/env/ready_layers", pattern = "_cur", full.names = T)[1])
+
+
+# Get mess for each species ----
+for (i in 1:length(species)) {
+
+ sp <- species[i]
+
+ # Load occurrence data
+ proj <- "+proj=laea +lat_0=0 +lon_0=-70 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs"
+ occ <- SpatialPoints(read.csv(paste0("data/", sp, "/", sp, "_filt.csv"))[,1:2],
+ proj4string = CRS(proj))
+
+ # Select used environmental layers
+ env.used <- env[[layers[[i]]]]
+ r12.used <- r12[[layers[[i]]]]
+ r24.used <- r24[[layers[[i]]]]
+ r37.used <- r37[[layers[[i]]]]
+
+ # Get environmental information on points
+ env.used.pts <- raster::extract(env.used, rbind(occ, ips))
+
+ env.mess <- ecospat.mess(rasterToPoints(env.used), cbind(coordinates(rbind(occ, ips)), env.used.pts))
+ r12.mess <- ecospat.mess(rasterToPoints(r12.used), cbind(coordinates(rbind(occ, ips)), env.used.pts))
+ r24.mess <- ecospat.mess(rasterToPoints(r24.used), cbind(coordinates(rbind(occ, ips)), env.used.pts))
+ r37.mess <- ecospat.mess(rasterToPoints(r37.used), cbind(coordinates(rbind(occ, ips)), env.used.pts))
+
+ env.mess.t <- base.env
+ r12.mess.t <- base.env
+ r24.mess.t <- base.env
+ r37.mess.t <- base.env
+
+ env.mess.t[cellFromXY(env.mess.t, env.mess[,1:2])] <- env.mess[,5]
+ r12.mess.t[cellFromXY(r12.mess.t, r12.mess[,1:2])] <- r12.mess[,5]
+ r24.mess.t[cellFromXY(r24.mess.t, r24.mess[,1:2])] <- r24.mess[,5]
+ r37.mess.t[cellFromXY(r37.mess.t, r37.mess[,1:2])] <- r37.mess[,5]
+
+ env.mess <- mask(env.mess.t, base.env)
+ r12.mess <- mask(r12.mess.t, base.env)
+ r24.mess <- mask(r24.mess.t, base.env)
+ r37.mess <- mask(r37.mess.t, base.env)
+
+ env.mess <- as.data.frame(rasterToPoints(env.mess))
+ r12.mess <- as.data.frame(rasterToPoints(r12.mess))
+ r24.mess <- as.data.frame(rasterToPoints(r24.mess))
+ r37.mess <- as.data.frame(rasterToPoints(r37.mess))
+
+ env.mess[,3] <- ifelse(env.mess[,3] > 0, "Extrapolation", "No extrapolation")
+ r12.mess[,3] <- ifelse(r12.mess[,3] > 0, "Extrapolation", "No extrapolation")
+ r24.mess[,3] <- ifelse(r24.mess[,3] > 0, "Extrapolation", "No extrapolation")
+ r37.mess[,3] <- ifelse(r37.mess[,3] > 0, "Extrapolation", "No extrapolation")
+
+ colnames(env.mess)[3] <- "MESSneg"
+ colnames(r12.mess)[3] <- "MESSneg"
+ colnames(r24.mess)[3] <- "MESSneg"
+ colnames(r37.mess)[3] <- "MESSneg"
+
+ # Load predictions species
+ preds <- list.files(paste0("results/", sp, "/predictions"), full.names = T)
+ preds <- preds[grepl("cont", preds)]
+ preds <- preds[grepl("mean", preds)]
+
+ env.pred <- stack(preds[grepl("current", preds)])
+ r12.pred <- stack(preds[grepl("ssp1", preds)])
+ r24.pred <- stack(preds[grepl("ssp2", preds)])
+ r37.pred <- stack(preds[grepl("ssp3", preds)])
+
+ maxval <- maxValue(env.pred)
+
+ r12.pred[r12.pred <= maxval] <- NA
+ r24.pred[r24.pred <= maxval] <- NA
+ r37.pred[r37.pred <= maxval] <- NA
+
+ r12.pred[!is.na(r12.pred)] <- 1
+ r24.pred[!is.na(r24.pred)] <- 1
+ r37.pred[!is.na(r37.pred)] <- 1
+
+ r12.pred <- aggregate(buffer(rasterToPolygons(r12.pred, dissolve = T), 0.0001))
+ r24.pred <- aggregate(buffer(rasterToPolygons(r24.pred, dissolve = T), 0.0001))
+ r37.pred <- aggregate(buffer(rasterToPolygons(r37.pred, dissolve = T), 0.0001))
+
+ r12.pred <- sf::st_as_sf(r12.pred)
+ r24.pred <- sf::st_as_sf(r24.pred)
+ r37.pred <- sf::st_as_sf(r37.pred)
+
+ # Prepare theme/ploting stuff ----
+ # Guide for legend
+ step.guide <- guide_legend(title = NULL,
+ # show.limits = TRUE,
+ keyheight = unit(0.2, "in"),
+ keywidth = unit(0.7, "in"),
+ ticks = T,
+ ticks.colour = "grey20",
+ frame.colour = "grey20",
+ title.position = "left",
+ title.hjust = 0.5,
+ label.position = "bottom",
+ label.hjust = 0.5)
+
+ nlt <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_blank(),
+ axis.title.x.top = element_text(vjust = 2, size = 16),
+ axis.title.y.left = element_text(size = 16),
+ legend.position="none",
+ panel.grid.major = element_line(linetype = 'dashed',
+ colour = "grey70",
+ size = .05),
+ panel.background = element_blank()#,
+ #plot.background = element_rect(color = "grey30", fill = 'white')
+ )
+
+ wlt <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_text(colour = "grey60", size = 14),
+ axis.title.x.top = element_text(vjust = 2, size = 16),
+ axis.title.y.left = element_text(size = 16),
+ panel.background = element_blank(),
+ panel.border = element_rect(fill = NA, color = "grey60"),
+ panel.grid.major = element_line(linetype = 'dashed',
+ colour = "grey70",
+ size = .1),
+ legend.position="bottom",
+ legend.title.align=0.5,
+ legend.text = element_text(size = 14),
+ legend.title = element_text(size = 16),
+ legend.background = element_rect(fill = "white"),
+ legend.spacing.x = unit(0.1, 'cm')
+ )
+
+ int <- theme_classic()+
+ theme(axis.line = element_blank(),
+ axis.ticks = element_blank(),
+ axis.text = element_blank(),
+ axis.title = element_blank(),
+ legend.position="none",
+ panel.grid.major = element_blank(),
+ panel.background = element_blank(),
+ plot.background = element_rect(color = "grey30", fill = 'white'),
+ plot.margin = margin(0.5, 0.5, 0, 0, "pt")
+ )
+
+ sca <- scale_fill_manual(values = c("#DC267F", "grey80"),
+ name = NULL,
+ #guide = step.guide,
+ na.value = "grey70")
+
+ # sca <- scale_fill_stepsn(breaks = c(),
+ # limits = c(8, 30),
+ # colors = rev(RColorBrewer::brewer.pal(10, "RdYlBu")),
+ # na.value = NA,
+ # guide = step.guide)
+ #
+
+ # Generate plots ----
+ ##### Current ----
+ (pc <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = env.mess, aes(x = x, y = y, fill = as.factor(MESSneg))) +
+ sca + # Add color scale
+ # Add occurrence points
+ # geom_point(data = data.frame(occ@coords),
+ # aes(x = decimalLongitude, y = decimalLatitude), size = 1,
+ # alpha = .2, shape = 16)+
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "N",
+ top = ""
+ )) +
+ geom_label(aes(label = "A", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab("Northing") + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+
+ ##### SSP1 ----
+ (ps1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = r12.mess, aes(x = x, y = y, fill = as.factor(MESSneg))) +
+ sca + # Add color scale
+ geom_sf(data = r12.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Add title
+ geom_label(aes(label = "B", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+
+
+ ##### SSP2 ----
+ (ps2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = r24.mess, aes(x = x, y = y, fill = as.factor(MESSneg))) +
+ sca + # Add color scale
+ geom_sf(data = r24.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Add title
+ geom_label(aes(label = "C", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+ ##### SSP3 ----
+ (ps3 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = r37.mess, aes(x = x, y = y, fill = as.factor(MESSneg))) +
+ sca + # Add color scale
+ geom_sf(data = r37.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Add title
+ geom_label(aes(label = "D", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab("Easting") + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+
+ # Save composite ----
+ final <- pc + ggtitle("MESS") + theme(plot.title = element_text(size = 20)) +
+ ps1 + ps2 + ps3 + plot_layout(nrow = 1, guides = "collect") &
+ theme(legend.position='bottom')
+
+ # ggsave(paste0(paste0("figures/mess_", sp, ".jpg")), final,
+ # width = 50, height = 18, units = "cm", quality = 100)
+ #
+
+
+
+ ### Temperature plots ----
+ step.guide.a <- guide_colorbar(title = "Temperature (°C)",
+ show.limits = TRUE,
+ barheight = unit(0.12, "in"),
+ barwidth = unit(3.5, "in"),
+ ticks = F,
+ ticks.colour = "grey20",
+ frame.colour = "grey20",
+ title.position = "top",
+ label.theme = element_text(size = 10))
+
+ sca.a <- scale_fill_stepsn(breaks = if ("sst" %in% names(env.used)) {seq(8,30,2)} else {seq(1,28.5,2.5)},
+ limits = if ("sst" %in% names(env.used)) {c(8,30)} else {c(1,28.5)},
+ colors = rev(RColorBrewer::brewer.pal(10, "RdYlBu")),
+ na.value = NA,
+ guide = step.guide.a)
+
+ step.guide.b <- guide_colorbar(title = "Difference in temperature (°C)",
+ show.limits = TRUE,
+ barheight = unit(0.12, "in"),
+ barwidth = unit(3.5, "in"),
+ ticks = F,
+ ticks.colour = "grey20",
+ frame.colour = "grey20",
+ title.position = "top")
+
+ sca.b <- scale_fill_distiller(
+ type = "seq",
+ palette = "RdPu",
+ direction = 1,
+ limits = if ("sst" %in% names(env.used)) {c(0.3,4.2)} else {c(0.6,6.7)},
+ na.value = NA,
+ guide = step.guide.b)
+
+ ##### Current ----
+ var <- if ("sst" %in% names(env.used)) {"sst"} else {"coldm"}
+ temp.comp <- as.data.frame(env.temp[,c("x", "y", var)])
+ colnames(temp.comp)[3] <- "values"
+
+ (pc <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = temp.comp,
+ aes(x = x, y = y, fill = values)) +
+ sca.a + # Add color scale
+ # Add occurrence points
+ # geom_point(data = data.frame(occ@coords),
+ # aes(x = decimalLongitude, y = decimalLatitude), size = 1,
+ # alpha = .2, shape = 16)+
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "N",
+ top = ""
+ )) +
+ geom_label(aes(label = "E", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+
+ ##### SSP1 ----
+ temp.comp <- as.data.frame(r12.temp.delta[,c("x", "y", var)])
+ colnames(temp.comp)[3] <- "values"
+
+ (ps1 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = temp.comp,
+ aes(x = x, y = y, fill = values)) +
+ sca.b + # Add color scale
+ geom_sf(data = r12.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Add title
+ geom_label(aes(label = "F", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+
+
+ ##### SSP2 ----
+ temp.comp <- as.data.frame(r24.temp.delta[,c("x", "y", var)])
+ colnames(temp.comp)[3] <- "values"
+
+ (ps2 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = temp.comp,
+ aes(x = x, y = y, fill = values)) +
+ sca.b + # Add color scale
+ geom_sf(data = r24.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Add title
+ geom_label(aes(label = "G", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+ ##### SSP3 ----
+ temp.comp <- as.data.frame(r37.temp.delta[,c("x", "y", var)])
+ colnames(temp.comp)[3] <- "values"
+
+ (ps3 <- ggplot()+
+ # Base maps
+ geom_sf(data = base,
+ color = c("#CFCFCF"),
+ size = 0.6,
+ fill = "white") +
+ # Get the raster
+ geom_raster(data = temp.comp,
+ aes(x = x, y = y, fill = values)) +
+ sca.b + # Add color scale
+ geom_sf(data = r37.pred, color = "grey20", fill = NA) +
+ # Establish area
+ coord_sf(xlim = c(-3239.984, 4510.636),
+ ylim = c(-4614.575, 4596.965),
+ datum = st_crs(base),
+ expand = F,
+ label_axes = list(
+ top = "E",
+ left = "",
+ top = ""
+ )) +
+ # Add title
+ geom_label(aes(label = "H", x = 4000, y = 4100),
+ size = 10, fontface = "bold", color = "grey30",
+ label.size = 0)+
+ # Remove axis labels and add theme
+ xlab(NULL) + ylab(NULL) + wlt +
+ # Add grid
+ scale_x_discrete(position = "top", breaks = c(-2000, 0, 2000, 4000))
+ )
+
+
+ # Save composite ----
+ final.temp <- pc + ggtitle("Temperature") + theme(plot.title = element_text(size = 20)) +
+ ps1 + ps2 + ps3 + plot_layout(nrow = 1, guides = "collect") &
+ theme(legend.position='bottom')
+
+ final.both <- final / final.temp
+
+ ggsave(paste0(paste0("figures/mess_temperature_", sp, ".jpg")), final.both,
+ width = 50, height = 36, units = "cm", quality = 100)
+
+}
diff --git a/codes/plot_sstpoints_lims.R b/codes/plot_sstpoints_lims.R
index 6e0b17d..131b550 100644
--- a/codes/plot_sstpoints_lims.R
+++ b/codes/plot_sstpoints_lims.R
@@ -4,6 +4,7 @@
# Plot of SST limits - all species
# Load needed packages ----
+set.seed(2020)
library(ggplot2)
library(ggdist)
library(patchwork)
diff --git a/docs/echinometra.html b/docs/echinometra.html
new file mode 100644
index 0000000..981d40c
--- /dev/null
+++ b/docs/echinometra.html
@@ -0,0 +1,1411 @@
+
+
+
+
+
+
+
+
+
+Echinometra lucunter – Western Atlantic sea urchins distribution
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Two species of Echinometra occur in the western Atlantic: E. viridis and E. lucunter . Echinometra lucunter is one of the most common sea urchins on Brazilian reefs, where it can attain great abundance in shallower areas. Although its importance in herbivory can be variable, species of this genus participate actively in the reef carbonate cycle.
+
+
+
+
+Alvaro E. Migotto. Black sea urchin. Cifonauta image database. Available at: http://cifonauta.cebimar.usp.br/media/4032/ Accessed: 2024-08-12.
+
+
+
+
+Current and future distribution (SDMs)
+Both E. lucunter and T. ventricosus showed areas of higher suitability in the Caribbean and south of the Gulf of Mexico, especially along the coast of Campeche to Quintana Roo (Mexico). Both species also show areas of high suitability along the Antilles. Echinometra lucunter has a higher range of distribution to the south.
+
+
+Code
+suppressPackageStartupMessages (library (terra))
+suppressPackageStartupMessages (library (sf))
+library (leaflet)
+library (leaflet.providers)
+library (leafem)
+
+ sp <- "eclu"
+
+ basedir <- paste0 ("../results/" , sp, "/predictions/" )
+
+ sdm_proj <- list.files (basedir)
+ sdm_proj <- sdm_proj[grepl ("mean" , sdm_proj)]
+ sdm_proj_cont <- sdm_proj[grepl ("cont" , sdm_proj)]
+
+ proj_lays <- rast (paste0 (basedir, sdm_proj_cont))
+ proj_lays <- project (proj_lays, "EPSG:3857" )
+
+# Normalize to 0-1
+ proj_lays <- (proj_lays - min (terra:: minmax (proj_lays$ eclu_mean_m4_cont_current)[1 ,])) / (terra:: minmax (proj_lays$ eclu_mean_m4_cont_current)[2 ,] - terra:: minmax (proj_lays$ eclu_mean_m4_cont_current)[1 ,])
+
+# Get areas of extrapolation
+ extrap_lays <- proj_lays[[2 : 4 ]]
+ extrap_lays[extrap_lays <= terra:: minmax (proj_lays$ eclu_mean_m4_cont_current)[2 ,]] <- NA
+ extrap_lays[! is.na (extrap_lays)] <- 1
+
+ extrap_shape <- lapply (1 : 3 , function (id){
+ terra:: project (terra:: as.polygons (extrap_lays[[id]]), "EPSG:4326" )
+ })
+
+# Set maximum to the maximum of current layer
+ proj_lays[proj_lays > 1 ] <- 1
+
+# Load points
+ pts <- read.csv (paste0 ("../data/" , sp, "/" , sp, "_filt.csv" ))
+ pts <- vect (pts, geom = c ("x" , "y" ), crs = crs (rast (paste0 (basedir, sdm_proj_cont[1 ]))))
+ pts <- project (pts, "EPSG:4326" )
+ pts <- as.data.frame (geom (pts))
+
+# Plot maps
+leaflet () %>%
+ #addProviderTiles("OpenStreetMap.Mapnik", group = "OSM") %>%
+ addProviderTiles ("Esri.WorldGrayCanvas" , group = "ESRI Gray" ) %>%
+ addRasterImage (
+ proj_lays[[1 ]],
+ project = F,
+ colors = colorNumeric (
+ palette = rev (c ("#A84C00" , "#D97D27" , "#F5BD44" , "#FFD561" , "#FFF291" ,
+ "#FFFFBF" , "#E0F3F8" , "#ABD9E9" , "#74ADD1" , "#4575B4" , "#313695" )),
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "Current"
+ ) %>%
+ addRasterImage (
+ proj_lays[[2 ]],
+ project = F,
+ colors = colorNumeric (
+ palette = rev (c ("#A84C00" , "#D97D27" , "#F5BD44" , "#FFD561" , "#FFF291" ,
+ "#FFFFBF" , "#E0F3F8" , "#ABD9E9" , "#74ADD1" , "#4575B4" , "#313695" )),
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP1 (RCP2.6)"
+ ) %>%
+ addPolygons (data = extrap_shape[[1 ]], group = "SSP1 (RCP2.6)" ) %>%
+ addRasterImage (
+ proj_lays[[3 ]],
+ project = F,
+ colors = colorNumeric (
+ palette = rev (c ("#A84C00" , "#D97D27" , "#F5BD44" , "#FFD561" , "#FFF291" ,
+ "#FFFFBF" , "#E0F3F8" , "#ABD9E9" , "#74ADD1" , "#4575B4" , "#313695" )),
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP2 (RCP4.5)"
+ ) %>%
+ addPolygons (data = extrap_shape[[2 ]], group = "SSP2 (RCP4.5)" ) %>%
+ addRasterImage (
+ proj_lays[[4 ]],
+ project = F,
+ colors = colorNumeric (
+ palette = rev (c ("#A84C00" , "#D97D27" , "#F5BD44" , "#FFD561" , "#FFF291" ,
+ "#FFFFBF" , "#E0F3F8" , "#ABD9E9" , "#74ADD1" , "#4575B4" , "#313695" )),
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP3 (RCP7.0)"
+ ) %>%
+ addPolygons (data = extrap_shape[[3 ]], group = "SSP3 (RCP7.0)" ) %>%
+ addLegend (pal = colorNumeric (
+ palette = c ("#A84C00" , "#D97D27" , "#F5BD44" , "#FFD561" , "#FFF291" ,
+ "#FFFFBF" , "#E0F3F8" , "#ABD9E9" , "#74ADD1" , "#4575B4" , "#313695" ),
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ), values = values (proj_lays[[1 ]]), title = "ROR" , opacity = 1 , position = "bottomright" ,
+ labFormat = labelFormat (transform = function (x) sort (x, decreasing = TRUE ))) %>%
+ addCircleMarkers (lng = pts$ x, lat = pts$ y,
+ #clusterOptions = markerClusterOptions(),
+ radius = 5 , weight = 2.5 ,
+ group = "Occurrence" ) %>%
+ addLayersControl (
+ baseGroups = c ("Current" , "SSP1 (RCP2.6)" , "SSP2 (RCP4.5)" , "SSP3 (RCP7.0)" ),
+ overlayGroups = c ("Occurrence" ),
+ options = layersControlOptions (collapsed = FALSE )
+ ) %>%
+ setView (- 60 , 0 , zoom= 3 )
+
+
+
+
+
+
+Changes in future distribution (SDMs)
+Echinometra lucunter do not present any apparent loss in its distribution range compared to the current scenario. This species would increase its range of suitable areas to the north and to the south.
+
+
+Code
+ delta <- proj_lays[[2 : 4 ]] - proj_lays[[1 ]]
+
+# Plot maps
+leaflet () %>%
+ #addProviderTiles("OpenStreetMap.Mapnik", group = "OSM") %>%
+ addProviderTiles ("Esri.WorldGrayCanvas" , group = "ESRI Gray" ) %>%
+ addRasterImage (
+ delta[[1 ]],
+ project = F,
+ colors = colorNumeric (
+ palette = "BrBG" ,
+ domain = c (- 1 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP1 (RCP2.6)"
+ ) %>%
+ addRasterImage (
+ delta[[2 ]],
+ project = F,
+ colors = colorNumeric (
+ palette = "BrBG" ,
+ domain = c (- 1 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP2 (RCP4.5)"
+ ) %>%
+ addRasterImage (
+ delta[[3 ]],
+ project = F,
+ colors = colorNumeric (
+ palette = "BrBG" ,
+ domain = c (- 1 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP3 (RCP7.0)"
+ ) %>%
+ addLegend (pal = colorNumeric (
+ palette = "BrBG" ,
+ domain = c (- 1 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = T
+ ), values = seq (- 1 , 1 , by = 0.1 ), title = "Delta ROR" , opacity = 1 , position = "bottomright" ,
+ labFormat = labelFormat (transform = function (x) sort (x, decreasing = TRUE ))) %>%
+ addCircleMarkers (lng = pts$ x, lat = pts$ y,
+ #clusterOptions = markerClusterOptions(),
+ radius = 5 , weight = 2.5 ,
+ group = "Occurrence" ) %>%
+ addLayersControl (
+ baseGroups = c ("SSP1 (RCP2.6)" , "SSP2 (RCP4.5)" , "SSP3 (RCP7.0)" ),
+ overlayGroups = c ("Occurrence" ),
+ options = layersControlOptions (collapsed = FALSE )
+ ) %>%
+ setView (- 60 , 0 , zoom= 3 )
+
+
+
+
+
+
+Current and future distribution (mechanistic model)
+Echinometra lucunter had a similar distribution than L. variegatus , but a smaller extension to the south and unsuitable areas in the northern portion of the Gulf of Mexico. Echinometra lucunter is expected to lose approximately 13, 48, and 65% of its suitable area in the SSP1, SSP2, and SSP3 scenarios.
+
+
+Code
+# Load layers and prepare
+# Load threshold data ----
+load ("../data/sst_limits/allspecies_oisst_thvalues.RData" )
+
+# Load results ----
+ sp <- "eclu" # Each species is run separately [try "eclu" and "trve"]
+
+# Load rasters generated before
+ curr <- rast (paste0 ("../data/sst_limits/" , sp, "_current_thresh.tif" ))
+ ssp1 <- rast (paste0 ("../data/sst_limits/" , sp, "_" , "ssp126" , "_thresh.tif" ))
+ ssp2 <- rast (paste0 ("../data/sst_limits/" , sp, "_" , "ssp245" , "_thresh.tif" ))
+ ssp3 <- rast (paste0 ("../data/sst_limits/" , sp, "_" , "ssp370" , "_thresh.tif" ))
+
+ curr <- project (curr, "EPSG:3857" )
+ ssp1 <- project (ssp1, "EPSG:3857" )
+ ssp2 <- project (ssp2, "EPSG:3857" )
+ ssp3 <- project (ssp3, "EPSG:3857" )
+
+# Get the percentage of time to use as threshold (mean of min and max point)
+ lval <- round (((thresholds[[sp]]$ time_inrange_hottest_point +
+ thresholds[[sp]]$ time_inrange_coolest_point)/ 2 ),
+ 2 ) # round to 2 digits
+
+
+# Get the polygons of the areas that are suitable
+ get.pol <- function (x){
+ # temp <- terra::app(x, function(x){
+ # x[x < lval] <- NA
+ # x[x >= lval] <- 1
+ # x
+ # })
+ # temp <- as.polygons(temp)
+ # temp <- aggregate(buffer(temp,0.0001)) # We use a negligible value here
+ # # to solve problems in the pols
+ # # conversion.
+ # temp <- project(temp, "EPSG:4326")
+ # # temp <- st_as_sf(temp)
+ # # temp <- st_set_crs(temp, crs("EPSG:4326"))
+ # temp
+ x[x < lval] <- NA
+ x[x >= lval] <- 1
+ terra:: project (terra:: as.polygons (x), "EPSG:4326" )
+ }
+
+ curr.p <- get.pol (curr)
+ ssp1.p <- get.pol (ssp1)
+ ssp2.p <- get.pol (ssp2)
+ ssp3.p <- get.pol (ssp3)
+
+
+
+# Plot maps
+leaflet () %>%
+ #addProviderTiles("OpenStreetMap.Mapnik", group = "OSM") %>%
+ addProviderTiles ("Esri.WorldGrayCanvas" , group = "ESRI Gray" ) %>%
+ addRasterImage (
+ curr,
+ project = F,
+ colors = colorNumeric (
+ palette = "Spectral" ,
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "Current"
+ ) %>%
+ addPolygons (data = curr.p,
+ group = "Current Suitable" ) %>%
+ addRasterImage (
+ ssp1,
+ project = F,
+ colors = colorNumeric (
+ palette = "Spectral" ,
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP1 (RCP2.6)"
+ ) %>%
+ addPolygons (data = ssp1.p,
+ group = "SSP1 Suitable" ) %>%
+ addRasterImage (
+ ssp2,
+ project = F,
+ colors = colorNumeric (
+ palette = "Spectral" ,
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP2 (RCP4.5)"
+ ) %>%
+ addPolygons (data = ssp2.p,
+ group = "SSP2 Suitable" ) %>%
+ addRasterImage (
+ ssp3,
+ project = F,
+ colors = colorNumeric (
+ palette = "Spectral" ,
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = FALSE
+ ),
+ group = "SSP3 (RCP7.0)"
+ ) %>%
+ addPolygons (data = ssp3.p,
+ group = "SSP3 Suitable" ) %>%
+ addLegend (pal = colorNumeric (
+ palette = "Spectral" ,
+ domain = c (0 ,1 ),
+ na.color = "#00000000" ,
+ alpha = FALSE ,
+ reverse = TRUE
+ ), values = seq (0 , 1 , by = 0.1 ), title = "% time" , opacity = 1 , position = "bottomright" ,
+ labFormat = labelFormat (transform = function (x) sort (x, decreasing = TRUE ) * 100 )) %>%
+ addCircleMarkers (lng = pts$ x, lat = pts$ y,
+ #clusterOptions = markerClusterOptions(),
+ radius = 5 , weight = 2.5 ,
+ group = "Occurrence" ) %>%
+ addLayersControl (
+ baseGroups = c ("Current" , "SSP1 (RCP2.6)" , "SSP2 (RCP4.5)" , "SSP3 (RCP7.0)" ),
+ overlayGroups = c ("Occurrence" , "Current Suitable" , "SSP1 Suitable" , "SSP2 Suitable" , "SSP3 Suitable" ),
+ options = layersControlOptions (collapsed = FALSE )
+ ) %>%
+ hideGroup (c ("Occurrence" , "Current Suitable" , "SSP1 Suitable" , "SSP2 Suitable" , "SSP3 Suitable" )) %>%
+ setView (- 60 , 0 , zoom= 3 )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/images/eclu_cifonauta.jpg b/docs/images/eclu_cifonauta.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..502d74bc2587a66cc53436edb7cf4f282c6b86f6
GIT binary patch
literal 112583
zcmeFZcUTn7(a*!Zda#nH{kqnY^Rzz}8
zBuKskzVV#jch2`c_ql&vd!L=DuBxu-uIcXSo~o&f$%{|G^#}4w@&F173ZMx7fQv19
zZ4DcQ3j%3_aHQqqH-i+Ik=fSBWUF~X;p2l5iTwW
zN>mJhTHV#zwlxpIVTs^?nLBehIzwF$vuX9>W&oFmo0fx?hnt%g2BSo^
z1&HM!HnwmC4C>-+PV3+bafQ1;ohebF0H(CFInvgF5>?|rUW^RDG`DnhxV$bIKnOt~
zU0Smcw9W{K4FY+E!-YUCY%eR}igdi>xrTJLfI*#+=9d{93n<*BwGwU%0eKApLaocf
zT2Kpfq>C*GQlc6IL>dUVi#e?&f>zqx0SdKs2C>|bRR0WK>mkm3LyG5;v_3-kI_(q9-}kb(jjg2z931g
z{si*?;0X4Z|CrELFUkLrbn*X&cBPqXm$I*P54ICk^4I?lEmDIN0J!R}SG?qxSu|Df
z@T)zSSpYj000{U&01uD@Ab<^E3%~&c00W?a3*Zcx1A-v!PaR$s_%rNB9Sk}%6
zSI2*$FcHqS*0yjc+!Y3v!IRUvl&*e-1M~Rit}X}#C>-i+?gF(05rDR*BlHhuoL|hB
zm`jQh%$gQF{eRtlG*@Q_Z8?2y@KXO!{=YG*NNec7Fqq~JF52eS|H2VKpbie&P!AU+
zq@uQ}iUk7Ua4GQGpXh%vW7{B{y`&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