R/get_donut_plot.R

Defines functions get_donut_plot

Documented in get_donut_plot

#' 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")
}
thierrycnam/igfuns documentation built on May 4, 2020, 3:21 a.m.