#' get_donut_plot
#'
#' Returns a donut plot
#'
#' @param df_1 dataframe
#' @param x quantitative variable to draw the donut
#' @param label qualitative variable to color the plot
#'
#' @return
#' @export
#' @importFrom ggpubr ggdonutchart
#' @importFrom rlang as_string
#'
#' @examples
get_donut_plot <- function(df_1, x, label) {
x <- as_string(enexpr(x))
label <- as_string(enexpr(label))
ggdonutchart(data = df_1,
x = x,
label = label,
fill = label,
palette = "pastel1")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.