Skip to content

Commit

Permalink
replaced purrr:keep() with Filter(f = \(val))
Browse files Browse the repository at this point in the history
because this is causing an error in the macOS GitHub Action
  • Loading branch information
n8thangreen committed Jan 10, 2025
1 parent 977ce87 commit 5376830
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R/ceac_plot_graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ceac_ggplot <- function(he,

graph_params <- helper_ggplot_params(he, graph_params)
legend_params <- make_legend_ggplot(he, pos_legend)
theme_add <- purrr::keep(extra_params, is.theme)
theme_add <- Filter(f = \(val) ggplot2::is.theme(val), x = extra_params)

ggplot(data_psa, aes(x = .data$k, y = .data$ceac)) +
geom_line(aes(linetype = .data$comparison,
Expand Down
3 changes: 1 addition & 2 deletions R/ceef_plot_graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ ceef_plot_ggplot <- function(he,

extra_args <- list(...)

opt_theme <- purrr::keep(extra_args, is.theme)

opt_theme <- Filter(f = \(val) ggplot2::is.theme(val), x = extra_args)
ceplane <- ggplot(ceef.points, aes(x = .data$x, y = .data$y))

if (add_dominance_region) {
Expand Down
2 changes: 1 addition & 1 deletion R/ceplane_plot_graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ ceplane_plot_ggplot.bcea <- function(he,
plot_params <-
ceplane_ggplot_params(he, pos_legend, graph_params, ...)

theme_add <- purrr::keep(list(...), is.theme)
theme_add <- Filter(f = \(val) ggplot2::is.theme(val), x = list(...))

ggplot(delta_ce,
aes(x = .data$delta_e, y = .data$delta_c,
Expand Down
2 changes: 1 addition & 1 deletion R/contour_graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contour_ggplot <- function(he,
plot_params <-
contour_ggplot_params(he, graph_params, ...)

theme_add <- purrr::keep(list(...), is.theme)
theme_add <- Filter(f = \(val) ggplot2::is.theme(val), x = list(...))

# single long format for ggplot data
delta_ce <-
Expand Down
3 changes: 2 additions & 1 deletion R/eib_plot_graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ eib_plot_ggplot <- function(he,
##TODO: can we move this up a level?
cri_params <- eib_params_cri(he, graph_params)

theme_add <- purrr::keep(extra_params, is.theme)
theme_add <- Filter(f = \(val) ggplot2::is.theme(val), x = extra_params)

legend_params <- make_legend_ggplot(he, graph_params$pos)
graph_params <- eib_params_ggplot(he, graph_params, cri_params)

Expand Down
3 changes: 2 additions & 1 deletion R/evppi_plot_ggplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ evppi_plot_ggplot <- function(evppi_obj,
evppi_obj$parameters),
"EVPI"))

theme_add <- purrr::keep(extra_args, is.theme)
theme_add <- Filter(f = \(val) ggplot2::is.theme(val), x = extra_args)

size <- purrr::pluck(extra_args, "size", .default = c(1, 0.5))

legend_params <- make_legend_ggplot(evppi_obj, pos_legend)
Expand Down
4 changes: 2 additions & 2 deletions R/plot.bcea.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ plot.bcea <- function(x,
extra_params,
keep.null = TRUE)

theme_add <- purrr::keep(extra_args, is.theme)
theme_add <- Filter(f = \(val) ggplot2::is.theme(val), x = extra_args)

ceplane.pos <- ifelse(pos, pos, c(1, 1.025))
ceplane.pos <- ifelse(pos, pos, c(1, 1.025))

##TODO: warnings...
ceplane <-
Expand Down

0 comments on commit 5376830

Please sign in to comment.