R/get_geom_boxplot.R

Defines functions get_geom_boxplot

Documented in get_geom_boxplot

#' geom box plot
#'
#' @param var_1 qualitative variable for x axis
#' @param var_2 quantitative variable for y axis
#' @param var_3 qualitative variable for color
#'
#' @return a nice boxplot
#' @export
#'
#' @examples
get_geom_boxplot <- function(var_1, var_2, var_3) {
  plot_1 <-
    ggplot(df_1, aes_string(x=var_1, y=var_2)) +
    geom_boxplot(aes_string(color=var_3)) +
    ggtitle(sprintf("%s VS %s", var_1, var_2)) +
    xlab(var_1) +
    ylab(var_2) +
    theme_bw()
  plot_1
}
thierrycnam/nbafuns documentation built on Sept. 30, 2019, 1:41 p.m.