plot_indiv_boxplot: Creates single box plot.

View source: R/boxplot.R

plot_indiv_boxplotR Documentation

Creates single box plot.

Description

Creates single box plot.

Usage

plot_indiv_boxplot(
  df,
  labels = "Group",
  out_dir = ".",
  log10_y = F,
  font_size = 25,
  show_stats = T,
  line_size = 1.3,
  lvl.colors = NA,
  xlab = "",
  ylab = "value",
  rowAnns = c(NA, NA),
  alpha_dots = 0.8,
  alpha_box = 1,
  point_size = 2,
  gradient_palette = "Spectral",
  jit_w = 0.1,
  pval.test = "t.test",
  pval.label = "p.signif",
  trim_x = 3,
  save.to.file = T,
  legend_position = "right"
)

Arguments

df

2-3 columns. 1) Box or level, 2) Value 3) Dots (color)

labels

A character vector of at least length 1 that will be collapsed for file name/plot titles.

out_dir

The output directory where the plot will be saved, default is current working directory.

log10_y

Logical (TRUE/FALSE) indicating whether to log10-transform y-axis.

font_size

The size of axis.text. The size of axis.title and plot.title is font_size / 1.3 and font_size / 2, respectively. The size of plot.subtitle, legend.text, and legend.title is font_size/3.

show_stats

Logical, if TRUE, will show statistics between all comparisons/boxes.

line_size

The thickness of axis lines.

lvl.colors

A vector of colors to manually specify box colors.

xlab

X axis label.

ylab

Y axis label.

rowAnns

Optional. A character vector of 1-2 column names in ds$rowAnn.

alpha_dots

Transparency (alpha) of dots. Accepted values in range 0-1.

alpha_box

Transparency (alpha) of boxes. Accepted values in range 0-1.

point_size

Size of dots.

jit_w

Jitter width of dots.

pval.test

Only applies if show_stats is TRUE. String corresponding to method parameter in stat_compare_means. Allowed values are "t.test" and "wilcox.test".

pval.label

p-values on box plots, either "p.signif" (stars), "p.format" (numeric), etc.

trim_x

Number of characters in x-axis labels.

save.to.file

If TRUE, save plot to file in out_dir. If FALSE, print to panel.

Value

Plot object if save.to.file is FALSE.

See Also

Other plotting: plot_corrplot(), plot_corrplotgg(), plot_discrete_barplot(), plot_heatmap(), plot_het_barplot(), plot_indiv_corrscatt(), plot_indiv_paired(), plot_overview_boxplot(), plot_overview_corr_scatt(), plot_profile_barplot(), run_corrplot_analysis()


kazeera/hourglass documentation built on April 5, 2025, 7:18 a.m.