gg_boxplots {ggDoE} | R Documentation |
Boxplots using ggplot2
gg_boxplots( data, response, factor, group_var = NULL, jitter_points = FALSE, horizontal = FALSE, point_size = 1, alpha = 1, color_palette = NA, direction = 1, show_mean = FALSE )
data |
provided dataset |
response |
A character string indicating the response of the data |
factor |
A character string indicating the factor of the data |
group_var |
A character string indicating the groups for facet_wrap |
jitter_points |
Overlay jittered points to boxplots. Default is FALSE. |
horizontal |
Determine whether to change the orientation of the plot. Default is FALSE |
point_size |
Change size of points (outliers) in boxplots |
alpha |
The alpha transparency, a number in [0,1] |
color_palette |
A character string indicating the color map option to use. Eight options are available: "viridis","cividis","magma","inferno","plasma","rocket","mako","turbo" |
direction |
Sets the order of colors in the scale. If 1, the default, colors are ordered from darkest to lightest. If -1, the order of colors is reversed |
show_mean |
Display the mean for each boxplot. Default is FALSE |
Boxplots created with ggplot2
data <- ToothGrowth data$dose <- factor(data$dose,levels = c(0.5, 1, 2),labels = c("D0.5", "D1", "D2")) gg_boxplots(data,response = "len",factor = "dose",alpha=0.6) gg_boxplots(data,response = "len",factor = "dose",group_var = "supp", alpha=0.6,color_palette = 'viridis',jitter_points=TRUE)