Description Usage Arguments Value Author(s) See Also Examples

This function simulates 2D NMR spectra. Only 1st order coupling can be handled – there is currently no capacity for doublet of doublets and other such peaks. The field strength of the "instrument" is taken into account.

1 2 |

`peaks` |
A data frame with the following columns: delta, mult (multiplicity), J, area, pw. Multiplicity should be given by a number, so use 2 for a doublet. J is in Hz (use 0 for singlets). pw is the peak width at half-height in Hz. |

`x.range` |
A numeric vector of length 2 giving the ppm range desired. Must be increasing. |

`MHz` |
Integer. The operating frequency of the instrument, in MHz. |

`ppHz` |
Points per Hz: The number of data points per Hz to use in
calculating the spectrum (passed as argument |

`type` |
The type of 2D spectrum desired. One of |

`M` |
An adjacency matrix indicating which peaks are coupled.
The order of rows and columns must be the same as in |

`levels` |
A vector of levels for the contour plot. Must be in (0...1). |

`...` |
Parameters to be passed to the plotting function. |

Returns a matrix.

Bryan A. Hanson, DePauw University. hanson@depauw.edu

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | ```
### ethyl 2-ethyl-3-oxobutyrate
### Set up data
peaks1 <- data.frame(
# A B C D E F
delta = c(4.20, 3.34, 2.23, 1.88, 1.28, 0.94),
mult = c(4, 3, 1, 5, 3, 3),
J = c(14, 14, 0, 14, 14, 14),
area = c(2, 1, 3, 2, 3, 3),
pw = c(2, 2, 2, 2, 2, 2))
# A, B, C, D, E, F
AM <- matrix(c(0, 0, 0, 0, 1, 0, # A
0, 0, 0, 1, 0, 0, # B
0, 0, 0, 0, 0, 0, # C
0, 1, 0, 0, 0, 1, # D
1, 0, 0, 0, 0, 0, # E
0, 0, 0, 1, 0, 0), # F
ncol = 6)
### 1D 1H NMR plot for reference
# CRAN checks will skip some examples to save time
jnk <- plotNMRspec(peaks = peaks1, x.range = c(0, 5), MHz = 500,
main = "1H NMR of ethyl 2-ethyl-3-oxobutyrate")
### 2D COSY plot
res <- plot2DNMRspec(peaks = peaks1, x.range = c(0, 5), MHz = 500, ppHz = 1, M = AM,
main = "COSY of ethyl 2-ethyl-3-oxobutyrate")
### 2D TOCSY plot
## Not run:
res <- plot2DNMRspec(peaks = peaks1, x.range = c(0, 5), MHz = 500, ppHz = 1,
levels = c(0.85, 0.9, 0.95), type = "TOCSY",
main = "TOCSY of ethyl 2-ethyl-3-oxobutyrate")
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.