#' 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
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.