Skip to content

Commit 381daf4

Browse files
committed
fix pp_cpu_2
1 parent 52f8cfb commit 381daf4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

R/mod_resp_curv_plot_species.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ rc_plot_species <- function(
246246

247247
quant_data <- data0$plot_data_quant[[.x]] %>%
248248
tidyr::pivot_wider(
249-
id_cols = XVals, names_from = quantile, values_from = pred) %>%
250-
stats::setNames(c("XVals", "q_25", "q_50", "q_975"))
249+
id_cols = x_vals, names_from = quantile, values_from = pred) %>%
250+
stats::setNames(c("x_vals", "q_25", "q_50", "q_975"))
251251

252252
rug_0 <- dplyr::filter(data0$observed_pa[[.x]], pred == 0)
253253
rug_1 <- dplyr::filter(data0$observed_pa[[.x]], pred == 1)
@@ -269,7 +269,7 @@ rc_plot_species <- function(
269269

270270
# Fixed y-axis
271271
plot_fixed <- ggplot2::ggplot(
272-
data = quant_data, mapping = ggplot2::aes(x = XVals),
272+
data = quant_data, mapping = ggplot2::aes(x = x_vals),
273273
environment = emptyenv()) +
274274
ggplot2::geom_line(
275275
ggplot2::aes(y = q_975), data = quant_data,
@@ -284,11 +284,11 @@ rc_plot_species <- function(
284284
mapping = ggplot2::aes(y = q_50), data = quant_data,
285285
linetype = 1, linewidth = 0.6, colour = "blue") +
286286
ggplot2::geom_rug(
287-
sides = "t", data = rug_1, ggplot2::aes(x = XVals),
287+
sides = "t", data = rug_1, ggplot2::aes(x = x_vals),
288288
color = "blue", linewidth = 0.025, alpha = 0.25,
289289
length = grid::unit(0.03, "npc")) +
290290
ggplot2::geom_rug(
291-
sides = "b", data = rug_0, ggplot2::aes(x = XVals),
291+
sides = "b", data = rug_0, ggplot2::aes(x = x_vals),
292292
color = "red", linewidth = 0.025, alpha = 0.25,
293293
length = grid::unit(0.03, "npc")) +
294294
ggplot2::geom_text(
@@ -305,7 +305,7 @@ rc_plot_species <- function(
305305

306306
# Free y-axis
307307
plot_free <- ggplot2::ggplot(
308-
data = quant_data, mapping = ggplot2::aes(x = XVals),
308+
data = quant_data, mapping = ggplot2::aes(x = x_vals),
309309
environment = emptyenv()) +
310310
ggplot2::geom_line(
311311
ggplot2::aes(y = q_975), data = quant_data,
@@ -320,11 +320,11 @@ rc_plot_species <- function(
320320
mapping = ggplot2::aes(y = q_50), data = quant_data,
321321
linetype = 1, linewidth = 0.6, colour = "blue") +
322322
ggplot2::geom_rug(
323-
sides = "t", data = rug_1, ggplot2::aes(x = XVals),
323+
sides = "t", data = rug_1, ggplot2::aes(x = x_vals),
324324
color = "blue", linewidth = 0.025, alpha = 0.25,
325325
length = grid::unit(0.03, "npc")) +
326326
ggplot2::geom_rug(
327-
sides = "b", data = rug_0, ggplot2::aes(x = XVals),
327+
sides = "b", data = rug_0, ggplot2::aes(x = x_vals),
328328
color = "red", linewidth = 0.025, alpha = 0.25,
329329
length = grid::unit(0.03, "npc")) +
330330
ggplot2::geom_text(

R/mod_resp_curv_plot_species_all.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ rc_plot_species_all <- function(
182182
dplyr::filter(quantile == 0.5)
183183
plot <- plot %>%
184184
ggplot2::ggplot(
185-
mapping = ggplot2::aes(x = XVals, y = pred, group = species),
185+
mapping = ggplot2::aes(x = x_vals, y = pred, group = species),
186186
environment = emptyenv()) +
187187
ggplot2::geom_line(
188188
linetype = 1, linewidth = 0.3,

0 commit comments

Comments
 (0)