plot_boxplot | R Documentation |
This function creates boxplot for each continuous feature based on a selected feature.
plot_boxplot(
data,
by,
binary_as_factor = TRUE,
geom_boxplot_args = list(),
geom_jitter_args = list(),
scale_y = "continuous",
title = NULL,
ggtheme = theme_gray(),
theme_config = list(),
nrow = 3L,
ncol = 4L,
parallel = FALSE
)
data |
input data |
by |
feature name to be broken down by. If selecting a continuous feature, boxplot will be grouped by 5 equal ranges, otherwise, all existing categories for a discrete feature. |
binary_as_factor |
treat binary as categorical? Default is |
geom_boxplot_args |
a list of other arguments to geom_boxplot |
geom_jitter_args |
a list of other arguments to geom_jitter. If empty, geom_jitter will not be added. |
scale_y |
scale of original y axis (before |
title |
plot title |
ggtheme |
complete ggplot2 themes. The default is theme_gray. |
theme_config |
a list of configurations to be passed to theme. |
nrow |
number of rows per page |
ncol |
number of columns per page |
parallel |
enable parallel? Default is |
invisibly return the named list of ggplot objects
geom_boxplot
plot_boxplot(iris, by = "Species", ncol = 2L)
plot_boxplot(iris, by = "Species", geom_boxplot_args = list("outlier.color" = "red"))
# Plot skewed data on log scale
set.seed(1)
skew <- data.frame(y = rep(c("a", "b"), 500), replicate(4L, rbeta(1000, 1, 5000)))
plot_boxplot(skew, by = "y", ncol = 2L)
plot_boxplot(skew, by = "y", scale_y = "log10", ncol = 2L)
# Plot with `geom_jitter`
plot_boxplot(iris, by = "Species", ncol = 2L,
geom_jitter_args = list(width = NULL)) # Turn on with default settings
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.