R/stat-boxjitter.R

#' @rdname ggpol-extensions
#' @importFrom ggplot2 ggproto Stat StatBoxplot
#' @format NULL
#' @usage NULL
#' @export
StatBoxJitter <- ggproto("StatBoxJitter", StatBoxplot,
   required_aes = c("y"),
   non_missing_aes = "weight",
   
   compute_group = function(data, scales, width = NULL, na.rm = FALSE, coef = 1.5) {
     df <- StatBoxplot$compute_group(data, scales, width, na.rm, coef)
     df$jitter_y <- list(data$y)
     df
   }
)

Try the ggpol package in your browser

Any scripts or data that you put into this service are public.

ggpol documentation built on Jan. 13, 2021, 12:16 p.m.