Skip to contents

Plots the specified traces from a list of chromatograms as a heatmap.

Usage

plot_chroms_heatmap(
  x,
  idx = NULL,
  lambdas,
  engine = c("base", "ggplot", "plotly"),
  show_legend = TRUE,
  xlim = NULL,
  legend_position = "topright",
  title = "",
  show_ylabs = FALSE
)

Arguments

x

A list of chromatograms in matrix format (timepoints × wavelengths) or a peak_table containing a pointer to a list of chromatograms accessible in the current environment.

idx

A vector representing the names or numerical indices of the chromatograms to plot.

lambdas

A character or numeric vector specifying the wavelengths to plot. Ignored for one-dimensional chromatograms.

engine

Plotting backend to use. One of "base", "ggplot", or "plotly".

show_legend

Logical. Whether to display legend or not. Defaults to TRUE.

xlim

Range of x axis values.

legend_position

Position of legend. Defaults to "topright"

title

Title for plot.

show_ylabs

Logical. Whether to show y labels. Defaults to FALSE.

Value

A plotly or ggplot object when engine = "plotly" or engine = "ggplot", respectively. No value is returned when engine = "base".

Details

Plots the traces of the chromatograms specified by idx at the specified wavelengths (lambdas) as a heatmap. Plots can be produced using base graphics engine, ggplot2, or plotly, according to the value of the engine argument. Adapted from VPdtw::plot.VPdtw.

Side effects

If engine == "base", the plot is rendered to the active graphics device.

Author

Ethan Bass

Examples

data(Sa_warp)
plot_chroms_heatmap(Sa_warp, lambdas = 210)