data: a data object (a data frame or a data.table)
iv_name: name of the independent variable
dv_name: name of the dependent variable
order_of_groups_top_to_bot: a character vector indicating the desired presentation order of levels in the independent variable (from the top to bottom). Omitting a group in this argument will remove the group in the set of histograms.
number_of_bins: number of bins for the histograms (default = 40)
space_between_histograms: space between histograms (minimum = 0, maximum = 1, default = 0.15)
draw_baseline: logical. Should the baseline and the trailing lines to either side of the histogram be drawn? (default = FALSE)
xlab: title of the x-axis for the histogram by group. If xlab = FALSE, the title will be removed. By default (i.e., if no input is given), dv_name will be used as the title.
ylab: title of the y-axis for the histogram by group. If ylab = FALSE, the title will be removed. By default (i.e., if no input is given), iv_name will be used as the title.
x_limits: a numeric vector with values of the endpoints of the x axis.
x_breaks: a numeric vector indicating the points at which to place tick marks on the x axis.
x_labels: a vector containing labels for the place tick marks on the x axis.
sigfigs: number of significant digits to round to (default = 3)
convert_dv_to_numeric: logical. Should the values in the dependent variable be converted to numeric for plotting the histograms? (default = TRUE)
Returns
the output will be a set of vertically arranged histograms (a ggplot object), i.e., one histogram for each level of the independent variable.
Details
The following package(s) must be installed prior to running this function: Package 'ggridges' v0.5.3 (or possibly a higher version) by Claus O. Wilke (2021), https://cran.r-project.org/package=ggridges