Learn R Programming

ume (version 1.5.2)

uplot_cvm: Plot of Molecular Mass (M) vs. Number of Carbon Atoms (C)

Description

Generates a scatter plot of molecular mass (M) versus carbon atom count (C), color-coded by a selected variable (z_var).

This visualization follows the concept of the Carbon-vs-Mass (CvM) diagram introduced by Reemtsma (2010).

Usage

uplot_cvm(
  df,
  z_var = "co_tot",
  palname = "redblue",
  tf = FALSE,
  col_bar = TRUE,
  gg_size = 12,
  logo = TRUE,
  plotly = FALSE,
  ...
)

Value

A ggplot2 or Plotly object.

Arguments

df

A data.table containing columns:

nm

Molecular mass (Da)

12C

Number of carbon atoms

z_var

Variable used for color projection

z_var

Character. Column used for color mapping.

palname

Character. Palette name passed to f_colorz().

tf

Logical. If TRUE, applies a transformation to the color scale (default is FALSE).

col_bar

Logical. If TRUE, adds a color legend (default is TRUE).

gg_size

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

logo

Logical. If TRUE, adds a UME caption.

plotly

Logical. If TRUE, return interactive plotly object.

...

Arguments passed on to f_colorz

z

Numeric vector. Values whose colors should be computed.

col_num

Integer. Number of colors in the palette (default: 100).

verbose

logical; if TRUE, show progress messages.

Details

Plot of Molecular Mass (M) vs. Number of Carbon Atoms (C)

References

Reemtsma, T. (2010). The carbon versus mass diagram to visualize and exploit FTICR-MS data of natural organic matter. J. Mass Spectrom., 45, 382–390. tools:::Rd_expr_doi("10.1002/jms.1722")

See Also

Other plots: uplot_cluster(), uplot_dbe_minus_o_freq(), uplot_dbe_vs_c(), uplot_freq_ma(), uplot_freq_vs_ppm(), uplot_hc_vs_m(), uplot_heteroatoms(), uplot_isotope_precision(), uplot_kmd(), uplot_lcms(), uplot_ma_vs_mz(), uplot_ms(), uplot_n_mf_per_sample(), uplot_pca(), uplot_ratios(), uplot_reproducibility(), uplot_ri_vs_sample(), uplot_vk()

Examples

Run this code
uplot_cvm(mf_data_demo, z_var = "co_tot", logo = FALSE)

Run the code above in your browser using DataLab