Selaa lähdekoodia

Add back box plot

Bryan Roessler 7 kuukautta sitten
vanhempi
commit
0bb07cf643
1 muutettua tiedostoa jossa 18 lisäystä ja 0 poistoa
  1. 18 0
      qhtcp-workflow/apps/r/calculate_interaction_zscores.R

+ 18 - 0
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) {