Plot multiple for a given peak in peak table. Wrapper for plot_spectrum.
Arguments
- loc
The peak, retention time, or scan index from which to extract spectral data.
- peak_table
A
peak_tableobject created byget_peaktable.- chrom_list
A list of chromatograms in matrix format (timepoints x wavelengths). If no argument is provided here, the function will try to find the
chrom_listobject using the pointer in thepeak_table.- idx
Vector of chromatograms to plot.
- engine
Which plotting engine to use:
base,ggplot2, orplotly.- plot_spectrum
Logical. If
TRUE, plots the spectrum of the chosen peak. Defaults toTRUE.- export_spectrum
Logical. If
TRUE, invisibly returns the spectrum as adata.frame. Defaults toFALSE.- scale_spectrum
Logical. If
TRUE, scales spectrum to unit height. Defaults toFALSE.- overlapping
Logical. If
TRUE, plot spectra in single plot.- verbose
Logical. If
TRUE, prints verbose output to console. Defaults toFALSE.- what
What to look for. Either
"peak"to extract spectral information for a certain peak,"rt"to scan by retention time, or"idx"to scan by numeric index. Defaults to "peak" mode.- peak
The name of a peak to plot (in character format).
- ...
Additional arguments to
plot_spectrum.
Value
If
export_spectrum = FALSE(default), aplotlyorggplotobject, or nothing ifengine == "base".If
export_spectrum = TRUE, invisibly returns adata.framewith wavelengths as rows and one column per sample encoding absorbance at each wavelength (normalized ifscale_spectrum = TRUE).
See also
Other visualization functions:
boxplot.peak_table(),
mirror_plot(),
plot.peak_list(),
plot.peak_table(),
plot_chroms(),
plot_chroms_heatmap(),
plot_spectrum(),
scan_chrom()
Examples
if (FALSE) { # interactive()
data(Sa_warp)
pks <- get_peaks(Sa_warp, lambda = "220")
pk_tab <- get_peaktable(pks)
plot_all_spectra(peak = "V13", peak_table = pk_tab, overlapping = TRUE)
}
