#' get_plot_vs (scatter_plot)
#'
#' @param df_1 df_1
#' @param var_1 variable 1
#' @param var_2 variable 2
#' @param var_3 color variable
#'
#' @return
#' @export
#' @import ggplot2
#'
#' @examples
get_plot_vs <- function(df_1, var_1, var_2, var_3) {
plot_2 <-
ggplot(df_1, aes_string(x=var_1, y=var_2)) +
geom_point(aes_string(color=var_3)) +
ggtitle(sprintf("%s VS %s", var_1, var_2)) +
xlab(var_1) +
ylab(var_2) +
theme_bw()
plot_2
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.