diff --git a/R/ggbetweenstats-helpers.R b/R/ggbetweenstats-helpers.R index 9335efc79..5f0b5846e 100644 --- a/R/ggbetweenstats-helpers.R +++ b/R/ggbetweenstats-helpers.R @@ -74,8 +74,7 @@ inherit.aes = FALSE, parse = TRUE, !!!centrality.label.args - ) + # adding sample size labels to the x axes - scale_x_discrete(labels = unique(centrality_df$n.expression)) + ) } #' @title Adding `geom_signif` to `ggplot` diff --git a/R/ggbetweenstats.R b/R/ggbetweenstats.R index e1f0a844e..ac7ce77f6 100644 --- a/R/ggbetweenstats.R +++ b/R/ggbetweenstats.R @@ -226,11 +226,14 @@ ggbetweenstats <- function( } # plot ----------------------------------- + # Transform the data to obtain sample sizes + centrality_df <- suppressWarnings(centrality_description(data, {{ x }}, {{ y }}, ...)) plot_comparison <- ggplot(data, mapping = aes({{ x }}, {{ y }})) + exec(geom_point, aes(color = {{ x }}), !!!point.args) + exec(geom_boxplot, !!!boxplot.args, outlier.shape = NA) + - exec(geom_violin, !!!violin.args) + exec(geom_violin, !!!violin.args) + # adding sample size labels to the x axes + scale_x_discrete(labels = unique(centrality_df$n.expression)) # centrality tagging -------------------------------------