Learn R Programming

SpecHelpers (version 0.1.6)

qMS: Draw a Simple Mass Spectrum Showing the Parent Ion

Description

Given a molecular formula, this function computes the mass of the parent ion, including any M + n peaks due to Br or Cl, and plots it. Intended to draw the parent ion region for small organic molecules, especially those with Br or Cl.

Usage

qMS(f = NULL, xlab = "m/z", ylab = "intensity", main = "Mass Spectrum",
  ...)

Arguments

f
A character string giving the molecular formula of the molecule of interest. Order of elements does not matter. Elements should be given as their atomic symbols, e.g. "Br" not "br".
xlab
A character string giving the x axis label.
ylab
A character string giving the y axis label.
main
A character string giving the title of the plot.
...
Additional arguments to be passed downstream.

Value

  • Draws a plot. Returns a data frame giving the peak masses and relative intensites.

Details

The function currently accepts formulas containing C, H, N, O, Br and Cl in any quantities.

Examples

Run this code
ms <- qMS(f = "C5H8BrCl", xlim = c(150, 200), main = "Parent Ion of C5H8BrCl")

Run the code above in your browser using DataLab