grouped_barplot: Grouped barplot

grouped_barplotR Documentation

Grouped barplot

Description

Creates a grouped barplot.

Usage

grouped_barplot(
  data,
  x_var,
  y_var,
  rm_ids = NULL,
  fill = NULL,
  alpha = 1,
  lwd = 1,
  line_color = "black",
  x_title = NULL,
  y_title = NULL,
  legend_title = NULL,
  use_na = c("ifany", "never", "always"),
  use_proportions = F
)

Arguments

data

A data frame with columns from which to retrieve variables to plot.

x_var

A string denoting the column name of the primary barplot variable.

y_var

A string denoting the column name of the secondary barplot variable.

rm_ids

A string vector of the row names to exclude prior to plotting.

fill

A string denoting the line color for barplot bars.

alpha

A numeric value for the alpha level for barplot bars.

lwd

A numeric value for the barplot bar line width.

x_title

A string denoting the x-axis title.

y_title

A string denoting the y-axis title.

legend_title

A string denoting the legend title. Should correspond to y_var.

use_na

One of "never", "ifany", or "always" to denote whether NA values should be included in the frequency calculations.

use_proportions

A boolean denoting if proportions should be used instead of frequencies.

Details

Creates a barplot for frequencies of two factor variables in which one variable is used to stratify the other.

Value

A ggplot object.


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