hist.coefs_dm: Plot Parameter Distribution(s)

View source: R/plotting.R

hist.coefs_dmR Documentation

Plot Parameter Distribution(s)

Description

This function creates a histogram for each parameter in a coefs_dm object, resulting from a call to coef.fits_ids_dm.

Usage

## S3 method for class 'coefs_dm'
hist(
  x,
  ...,
  conds = NULL,
  col = NULL,
  xlim = NULL,
  ylim = NULL,
  xlab = "value",
  ylab = NULL,
  bundle_plots = TRUE
)

Arguments

x

an object of class coefs_dm (see coef.fits_ids_dm)

...

additional graphical arguments passed to graphics::hist(). Not supported are the plot and probability arguments (the latter can be controlled via the supported freq argument). For further plotting arguments, see also set_default_arguments().

conds

a character vector specifying the conditions to plot. Defaults to all available conditions.

col

character vector, specifying colors for each condition, if conditions are present.

xlim

a numeric vector of length 2, specifying the x-axis limits.

ylim

a numeric vector of length 2, specifying the y-axis limits.

xlab, ylab

character strings for the x- and y-axis labels.

bundle_plots

logical, indicating whether to display separate panels in a single plot layout (FALSE), or to plot them separately (TRUE).

Details

The hist.coefs_dm function is designed for visualizing parameter distributions.

If multiple conditions are present, it overlays histograms for each condition with adjustable transparency.

When bundle_plots is set to TRUE, histograms for each parameter are displayed in a grid layout within a single graphics device.

This function has some customization options, but they are limited. If you want to have a highly customized histogram, it is best to create it on your own using R's graphics::hist() function (see the examples below).

Value

Nothing (NULL; invisibly)

Examples

# get an auxiliary fit procedure result (see the function load_fits_ids)
all_fits <- get_example_fits("fits_ids")
coefs <- coef(all_fits)
print(coefs)
hist(coefs, bundle_plots = FALSE) # calls hist.coefs_dm method of dRiftDM

# how to fall back to R's hist() function for heavy customization
coefs <- unpack_obj(coefs) # provides the plain data.frame
hist(coefs$muc, main = expression(mu[c])) # calls graphics::hist()


dRiftDM documentation built on Dec. 1, 2025, 5:08 p.m.