plot_nist {gcxgclab} | R Documentation |
Plots the mass spectra of a NIST compound.
Description
plot_nist
Plots the mass spectra of a NIST compound.
Usage
plot_nist(nistlist, k, ms, title = "NIST Mass Spectrum")
Arguments
nistlist |
a list object, a list of compound MS data from the NIST MS Library database, ideally the output of nist_list(). |
k |
a integer object, the index of the NIST compound in the nistlist input. |
ms |
a data.frame object, a data frame of the mass values and the percent intensity values, ideally the output of find_ms(). |
title |
a string object. Title placed at the top of the plot. Default title "Mass Spectrum". |
Details
This function produces line plot of the mass spectra data from the
sample on top, and the mass spectrum from a NIST compound entry on the
bottom. The mass values vs the percent intensity values as a percent of the
highest intensity using ggplot
from ggplot2 package
(Wickham 2016).
Value
A ggplot object. A line plot of the mass spectra data. The mass values vs the percent intensity values as a percent of the highest intensity.
References
Wickham H (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. ISBN 978-3-319-24277-4, https://ggplot2.tidyverse.org.