Skip to contents

Plots a chromatographic trace from the specified chromatogram (idx), at the specified wavelength (lambda) with a dotted red line to indicate the user-selected retention time. The trace is a single column from the chromatographic matrix.

Usage

scan_chrom(
  chrom_list,
  idx,
  lambda,
  plot_spectrum = TRUE,
  peak_table = NULL,
  scale_spectrum = FALSE,
  spectrum_labels = TRUE,
  export_spectrum = FALSE,
  ...
)

Arguments

chrom_list

A list of chromatograms in matrix format (timepoints × wavelengths). If no argument is provided here, the function will try to find the chrom_list object using the pointer in the peak_table.

idx

Index or name of the chromatogram to plot. If missing, you are prompted for one.

lambda

The wavelength at which to plot the chromatographic trace. Required; "max" is not accepted.

plot_spectrum

Logical. If TRUE, plots the spectrum of the chosen peak. Defaults to TRUE.

peak_table

A peak_table object created by get_peaktable.

scale_spectrum

Logical. If TRUE, scales spectrum to unit height. Defaults to FALSE.

spectrum_labels

Logical. If TRUE, plots labels on maxima in spectral plot. Defaults to TRUE.

export_spectrum

Logical. If TRUE, invisibly returns the spectrum as a data.frame. Defaults to FALSE.

...

Additional arguments to plot_spectrum.

Value

Invisibly returns the spectrum when export_spectrum = TRUE and plot_spectrum = TRUE; otherwise the numeric index of the scan selected by the user.

Details

If plot_spectrum is TRUE, plots the spectrum for the specified chromatogram at the user-specified retention time. The spectrum is a single row from the chromatographic matrix.

Side effects

Plots are rendered to the active graphics device.

Author

Ethan Bass

Examples

if (FALSE) { # interactive()
data(Sa_pr)
scan_chrom(Sa_pr, lambda = "210", idx = 2, export_spectrum = TRUE)
}