nmr_plot_spectra {nmrrr}R Documentation

Plot NMR spectra

Description

Plot NMR spectra, with line-brackets denoting binned regions. Uses spectra data processed in MestreNova or TopSpin.

Usage

nmr_plot_spectra(
  dat,
  binset,
  label_position = 100,
  mapping = aes(x = ppm, y = intensity),
  stagger = 10
)

Arguments

dat

Processed spectral data, output from (a) nmr_import_spectra and nmr_assign_bins; or (b) nmr_import_peaks

binset

A binset; e.g. bins_Clemente2012, bins_Hertkorn2013, etc., or a similarly-structured data frame

label_position

y-axis position for bin labels

mapping

An aesthetic mapping generated by aes: aes(x = ..., y = ...)

stagger

How much to stagger the labels, numeric; same units as label_position

Value

A ggplot object.

Author(s)

Kaizad Patel

Examples

sdir <- system.file("extdata", "kfp_hysteresis", "spectra_mnova", package = "nmrrr")
spec <- nmr_import_spectra(path = sdir, method = "mnova")
library(ggplot2)
p_aes <- aes(x = ppm, y = intensity)
p <- nmr_plot_spectra(spec, bins_Clemente2012, 5, p_aes, stagger = 0.5)
p + ylim(0, 6)


[Package nmrrr version 1.0.0 Index]