hist_boxplot: Histogram and jittered boxplot

View source: R/plot_utils.R

hist_boxplotR Documentation

Histogram and jittered boxplot

Description

Creates a histogram and jittered boxplot.

Usage

hist_boxplot(
  data,
  binsize = diff(range(data[, 1], na.rm = T))/50,
  hist_fill = "gray10",
  hist_alpha = 0.75,
  box_fill = "goldenrod",
  box_alpha = 0.5,
  box_lwd = 1,
  jitter_color = "gray30",
  jitter_alpha = 0.75,
  jitter_size = 1.75,
  x_title = "",
  y_title = ""
)

Arguments

data

A single column data frame with numeric values to be plotted.

binsize

A numeric value for the histogram bin widths.

hist_fill

A string. The fill color for histogram bars.

hist_alpha

A numeric value for the alpha level for histogram bars.

box_fill

A string. The fill color for the boxplot.

box_alpha

A numeric value for the alpha level for the boxplot.

box_lwd

A numeric value for the boxplot line width.

jitter_color

A string. The point color for jittered data points.

jitter_alpha

A numeric for the alpha level for jittered data points.

jitter_size

A numeric for the point size for jittered data points.

x_title

A string denoting the x-axis title. Only added to the boxplot.

y_title

A string denoting the y-axis title. Only added to the histogram.

Details

Creates two plots that can be organized as a single column two row multi-figure. The top row plot is a histogram. The bottom row plot is a horizontal boxplot with jittered data points overlayed. The x-axis of both plots are fixed to the same limits for comparability across plots. To create these plots but partitioned by a categorical variable, see hist_boxplot2.

Value

A list of two ggplot objects hist and boxplot.

See Also

hist_boxplot2


bryancquach/omixjutsu documentation built on Jan. 29, 2023, 3:47 p.m.