From 0bb07cf643e868eb202c61855116ae7cb91da167 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Sat, 14 Sep 2024 22:23:15 -0400 Subject: [PATCH] Add back box plot --- .../apps/r/calculate_interaction_zscores.R | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qhtcp-workflow/apps/r/calculate_interaction_zscores.R b/qhtcp-workflow/apps/r/calculate_interaction_zscores.R index 3a2c8d9d..46eb3d6a 100644 --- a/qhtcp-workflow/apps/r/calculate_interaction_zscores.R +++ b/qhtcp-workflow/apps/r/calculate_interaction_zscores.R @@ -521,6 +521,24 @@ generate_scatter_plot <- function(plot, config, interactive = FALSE) { return(plot) } +generate_box_plot <- function(plot, config) { + plot <- plot + geom_boxplot() + + if (!is.null(config$x_breaks) && !is.null(config$x_labels) && !is.null(config$x_label)) { + plot <- plot + scale_x_discrete( + name = config$x_label, + breaks = config$x_breaks, + labels = config$x_labels + ) + } + + if (!is.null(config$coord_cartesian)) { + plot <- plot + coord_cartesian(ylim = config$coord_cartesian) + } + + return(plot) +} + # Adjust missing values and calculate ranks adjust_missing_and_rank <- function(df, variables) {