View source: R/Chromatograms-plot.R
plotChromatograms | R Documentation |
Chromatograms()
can be plotted with the following functions:
The plotChromatograms()
: plots each chromatogram in its separate plot by
splitting the plot area into as many panels as there are spectra.
plotChromatograms(
x,
xlab = "rtime (s)",
ylab = "intensity",
type = "o",
pch = 20,
cex = 0.6,
lwd = 1.5,
xlim = numeric(),
ylim = numeric(),
main = character(),
col = "#00000080",
asp = 1,
...
)
plotChromatogramsOverlay(
x,
xlab = "rtime (s)",
ylab = "intensity",
type = "o",
pch = 20,
cex = 0.6,
lwd = 1.5,
xlim = numeric(),
ylim = numeric(),
main = paste(length(x), "chromatograms"),
col = "#00000080",
axes = TRUE,
frame.plot = axes,
...
)
x |
A Chromatograms object. |
xlab |
|
ylab |
|
type |
|
pch |
|
cex |
|
lwd |
|
xlim |
|
ylim |
|
main |
|
col |
color to be used to draw the peaks. Should be either of length 1,
or equal to the number of chromatograms (to plot each chromatograms
in a different color) or be a |
asp |
|
... |
Additional arguments to be passed to |
axes |
|
frame.plot |
|
These functions create a plot.
Philippine Louail, Johannes Rainer
## Create a Chromatograms object
cdata <- data.frame(msLevel = c(1L, 1L, 1L),
mz = c(112.2, 123.3, 134.4),
chromIndex = c(1L, 2L, 3L))
pdata <- list(
data.frame(rtime = c(12.4, 12.8, 13.2, 14.6),
intensity = c(123.3, 153.6, 2354.3, 243.4)),
data.frame(rtime = c(45.1, 46.2),
intensity = c(100, 80.1)),
data.frame(rtime = c(12.4, 12.8, 13.2, 14.6),
intensity = c(123.3, 153.6, 2354.3, 243.4))
)
chr <- backendInitialize(ChromBackendMemory(),
chromData = cdata,
peaksData = pdata) |> Chromatograms()
## Plot one chromatogram
plotChromatograms(chr[1])
## Plot the full Chromatograms object
plotChromatograms(chr)
## Define a color for each peak in each chromatogram
plotChromatograms(chr[1:2], col = c("green", "blue"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.