Learn R Programming

ume (version 1.5.2)

uplot_freq: Frequency Plot of a Selected Variable

Description

Creates a frequency plot (bar plot) for a selected variable in a molecular formula dataset. Values are grouped and counted, then visualized as bars. A unified UME plot theme is applied for consistent styling across all uplot_* functions.

Usage

uplot_freq(
  mfd,
  var = "14N",
  col = "grey",
  space = 0.5,
  width = 0.3,
  logo = TRUE,
  gg_size = 12,
  plotly = FALSE,
  ...
)

Value

A ggplot object, or a plotly object when plotly = TRUE.

Arguments

mfd

data.table with molecular formula data as derived from ume::assign_formulas. Column names of elements/isotopes must match names in the isotope column of ume::masses; values are integers representing counts per formula.

var

Character. Name of the variable for which the frequency distribution should be plotted (e.g. "14N").

col

Bar fill color.

space

Not used (kept for backward compatibility).

width

Bar width.

logo

Logical. If TRUE, adds a UME caption.

gg_size

Base text size for theme_uplots(). Default = 12.

plotly

Logical. If TRUE, return interactive plotly object.

...

Additional arguments passed to methods.