Skip to content

Commit 719c51d

Browse files
committed
several minor formatting changes
1 parent 820bee6 commit 719c51d

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

R/analysis/3-uncertainty-spatially-uniform.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ for (i in 1:nrow(s_df)) {
121121
}
122122

123123
# Save results
124-
write.csv(s_df, here('Data/montecaro_basin_10percentpert.csv'))
125-
write.csv(bt_df, here('Data/mc_uniform_basin_threshold.csv'))
126-
write.csv(bh_df, here('Data/mc_uniform_basin_hotspot.csv'))
124+
write.csv(s_df, here('Data/mc_basin_all_uniform.csv'))
125+
write.csv(bt_df, here('Data/mc_basin_threshold_uniform.csv'))
126+
write.csv(bh_df, here('Data/mc_basin_hotspot_uniform.csv'))

R/analysis/4-uncertainty-spatially-variable.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ for (i in 1:nrow(s_df)) {
135135
}
136136

137137
# Save results
138-
write.csv(s_df, here('Data/montecaro_basin_10percentpert_variable.csv'))
139-
write.csv(bt_df, here('Data/mc_uniform_basin_threshold_variable.csv'))
140-
write.csv(bh_df, here('Data/mc_uniform_basin_hotspot_variable.csv'))
138+
write.csv(s_df, here('Data/mc_basin_all_variable.csv'))
139+
write.csv(bt_df, here('Data/mc_basin_threshold_variable.csv'))
140+
write.csv(bh_df, here('Data/mc_basin_hotspot_variable.csv'))

R/plotting+analysis/figure-1-plotting.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tm <- tm_shape(basins_data, projection = "+proj=robin") +
3636
tm_polygons(col = "fwstrs", style = "cont",
3737
palette = scico(20, palette = "bilbao", direction = 1),
3838
midpoint = 0.2, breaks = c(0, 0.4), alpha = 1.00,
39-
lwd = 0.2) +
39+
lwd = 0.2, colorNA = 'grey50') +
4040
tm_shape(coastlines) +
4141
tm_borders(lwd = 0.7, col = "black") +
4242
tm_layout(legend.show = F, earth.boundary = c(-179, -60, 179, 88),

R/plotting+analysis/figure-s8-plotting+stats.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ invisible(sapply(paste0(here("R/setup"), "/", list.files(here("R/setup"))), sour
99
invisible(sapply(paste0(here("R/udf"), "/", list.files(here("R/udf"))), source))
1010

1111
# Import coastlines and basin shapefile with plotting data
12-
s_df <- read.csv(here('Data/montecaro_basin_10percentpert.csv'))
13-
bt_df <- read.csv(here('Data/mc_uniform_basin_threshold.csv'))
14-
bh_df <- read.csv(here('Data/mc_uniform_basin_hotspot.csv'))
12+
s_df <- read.csv(here('Data/mc_basin_all_uniform.csv'))
13+
bt_df <- read.csv(here('Data/mc_basin_threshold_uniform.csv'))
14+
bh_df <- read.csv(here('Data/mc_basin_hotspot_uniform.csv'))
1515

1616
# Select columns of interest to plot
1717
p_df <- s_df %>% dplyr::select(NhotH, NhotVH, Cptb, Qptb, Tptb, Aptb, Eptb, Vptb)
@@ -25,7 +25,7 @@ sensplot <-
2525
gather(-hotspots, key = "var", value = "value") %>%
2626
ggplot(aes(x = value, y = hotspots)) +
2727
geom_point(alpha = 0.05, size = 1) +
28-
geom_point(data = NULL, aes(x = 0, y = 172), color = "red", size = 1.5) +
28+
geom_point(data = NULL, aes(x = 0, y = 168), color = "red", size = 1.5) +
2929
# geom_smooth(alpha = 0.5) +
3030
facet_wrap(~ var, nrow = 1) +
3131
scale_y_continuous(limits = c(0, 300)) +

R/plotting+analysis/figure-s9-plotting+stats.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ invisible(sapply(paste0(here("R/setup"), "/", list.files(here("R/setup"))), sour
99
invisible(sapply(paste0(here("R/udf"), "/", list.files(here("R/udf"))), source))
1010

1111
# Import coastlines and basin shapefile with plotting data
12-
s_df <- read.csv(here('Data/montecaro_basin_10percentpert_variable.csv'))
13-
bt_df <- read.csv(here('Data/mc_uniform_basin_threshold_variable.csv'))
14-
bh_df <- read.csv(here('Data/mc_uniform_basin_hotspot_variable.csv'))
12+
s_df <- read.csv(here('Data/mc_basin_all_variable.csv'))
13+
bt_df <- read.csv(here('Data/mc_basin_threshold_variable.csv'))
14+
bh_df <- read.csv(here('Data/mc_basin_hotspot_variable.csv'))
1515

16+
# Select columns of interest to plot
1617
p_df <- s_df %>% dplyr::select(NhotH, NhotVH, Cpsd, Qpsd, Tpsd, Apsd, Epsd, Vpsd)
1718
names(p_df) <- c('NhotH', 'NhotVH', 'a) Consumption', 'b) Runoff', 'c) TWS', 'd) Adaptability', 'e) EFN', 'g) VSI')
1819
p_df$hotspots <- p_df$NhotH + p_df$NhotVH # Calculate hotspot total
@@ -24,7 +25,7 @@ sensplot <-
2425
gather(-hotspots, key = "var", value = "value") %>%
2526
ggplot(aes(x = value, y = hotspots)) +
2627
geom_point(alpha = 0.05, size = 1) +
27-
geom_point(data = NULL, aes(x = 0, y = 172), color = "red", size = 1.5) +
28+
geom_point(data = NULL, aes(x = 0, y = 168), color = "red", size = 1.5) +
2829
# geom_smooth(alpha = 0.5) +
2930
facet_wrap(~ var, nrow = 1) +
3031
scale_y_continuous(limits = c(0, 300)) +
@@ -127,5 +128,4 @@ summary_df %>% filter(Actual == 1) %>% filter(Freq >= 0.50) %>% nrow()
127128
summary_df %>% filter(Actual == 1) %>% filter(Freq < 0.50) %>% nrow()
128129

129130
# Number of *non* hotspots identified as so in > 50% of perturbations
130-
summary_df %>% filter(Actual == 0) %>% filter(Freq >= 0.50) %>% nrow()
131-
131+
summary_df %>% filter(Actual == 0) %>% filter(Freq >= 0.50) %>% nrow()

R/preprocessing/1-data-resolution-harmonization.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ GDP_2015_0d5 <- raster::aggregate(x = GDP_2015, fact = x, fun = sum, expand = F,
8787
filename = here::here("Data", "Dimensions",
8888
"GDP_2015_0d5.tif"))
8989

90+
9091
# Amphibian species richness ----
9192
amph <- raster(here::here("Data", "Dimensions", "all_amphibians.tif"))
9293
extent(amph) = c(-180, 180, -90, 90)

0 commit comments

Comments
 (0)