Description Usage Arguments Value
View source: R/distributions.R
Plot distributions with pairwise annotations and flexibility
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | plot_distributions(
data,
x,
y,
type = "quasirandom",
add_boxplot = ifelse(type %in% c("density", "ridge", "line"), FALSE, TRUE),
group = NULL,
color = NULL,
fill = NULL,
alpha = 1,
point_size = 1,
text_size = 2,
scale = "default",
annotate_counts = TRUE,
pairwise_annotation = NULL,
pairwise_annotation_label = "p_signif",
pairwise_annotation_exclude = c(),
pairwise_annotation_tier_width = 0.16,
lower_quantile = 0,
upper_quantile = 1,
drop_outliers = FALSE,
facet_rows = c(),
facet_columns = c(),
facet_type = "grid",
...
)
|
data |
data frame containing dataset to use for plotting |
x |
column for x-axis |
y |
column for y-axis |
type |
type of plot - can be "line", "sina", "quasirandom", "density", "violin", "box", or "ridge" |
add_boxplot |
boolean to add boxplot on top of selected plot type |
group |
column for group aesthethic, used if type == "line" |
color |
column for color |
fill |
column for fill |
alpha |
alpha of points |
point_size |
size of points for plot types with individual points |
text_size |
text size for count annotations |
scale |
either "default" for linearly-spaced scale or "log" for log-spaced |
annotate_counts |
boolean whether to annotate counts per group or not |
pairwise_annotation |
data frame containing pairwise annotations |
pairwise_annotation_label |
column of pairwise_annotation data to use for annotation text |
pairwise_annotation_exclude |
values to not annotate on pairwise annotations |
pairwise_annotation_tier_width |
relative distance between tiers for pairwise annotations, between 0 and 1 |
lower_quantile |
lower quantile beyond which to limit axis |
upper_quantile |
upper quantile beyond which to limit axis |
drop_outliers |
whether to drop outliers, or not (mask values at the limits) |
facet_rows |
columns for faceting by row |
facet_columns |
columns for faceting by column |
facet_type |
either "wrap" or "grid", corresponding to facet_wrap and facet_grid respectively |
... |
params passed into either facet_wrap or facet_grid, depending on facet_type parameter |
ggplot object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.