Description Usage Arguments Value Author(s) Examples
View source: R/shiftSpectra2D.R
Shift the spectra in a Spectra2D
object manually. During shifting, some rows
or columns are thrown away and new rows or columns are introduced. These new entries may
be filled with zeros, or noise from the original spectra.
(+) shiftF2
- shift right: trim right, fill left
(-) shiftF2
- shift left: trim left, fill right
(+) shiftF1
- shift up: trim top, fill bottom
(-) shiftF1
- shift down: trim bottom, fill top
1 2 3 4 5 6 7 | shiftSpectra2D(
spectra,
which = NULL,
shiftF2 = 0L,
shiftF1 = 0L,
fill = "noise"
)
|
spectra |
An object of S3 class |
which |
An integer specifying which spectra to shift. May be a vector. |
shiftF2 |
Integer. The number of data points to shift along the F2 dimension. See Details. |
shiftF1 |
As per |
fill |
Aligning spectra requires that at least some spectra be shifted left/right and up/down. When a spectrum is shifted, spaces are opened that must be filled with something:
|
An object of S3 class Spectra2D
.
Bryan A. Hanson, DePauw University.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data(MUD2)
# Show the first two spectra, overlaid
mylvls <- seq(5, 35, 5)
plotSpectra2D(MUD2,
which = 1:2, lvls = LofL(mylvls, 2),
cols = LofC(c("red", "black"), 2, length(mylvls), 2),
main = "MUD2 Sample 1 (black) & Sample 2 (red)"
)
# Now shift Sample 2
MUD2s <- shiftSpectra2D(MUD2, which = 2, shiftF1 = -2)
plotSpectra2D(MUD2s,
which = 1:2, lvls = LofL(mylvls, 2),
cols = LofC(c("red", "black"), 2, length(mylvls), 2),
main = "MUD2 Sample 1 (black) & Sample 2 (red)\n(samples now aligned/overlap)"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.