# You need to install package speaq for this example
# This example assumes the graphics output is set to ggplot2 (see ?GraphicsOptions).
if (requireNamespace("speaq", quietly = TRUE)) {
library("ggplot2")
data(alignMUD)
p1 <- plotSpectra(alignMUD, which = 1:20, lab.pos = 4.5, offset = 0.1,
yrange = c(0, 5000), amp = 500)
p1 <- p1 + ggtitle("Misaligned NMR Spectra") +
coord_cartesian(xlim = c(1.5, 1.8), ylim = c(0, 1900))
p1
aMUD <- clupaSpectra(alignMUD)
p2 <- plotSpectra(aMUD, which = 1:20, lab.pos = 4.5, offset = 0.1,
yrange = c(0, 5000), amp = 500)
p2 <- p2 + ggtitle("Aligned NMR Spectra") +
coord_cartesian(xlim = c(1.5, 1.8), ylim = c(0, 1900))
p2
}
Run the code above in your browser using DataLab