mask discards a spectral region

mask(x, ...)

# S3 method for collection
mask(x, from, to, overlaps = "keep", skip = FALSE, ...)

Arguments

x

Acollection object

...

further arguments passed to or from other methods(not currenctly used).

from, to

Coordinates of the region to mask. Use -Inf or Inf to shorten the spectra.

overlaps

What to do with the bins ovelapping the edge of the mask. Use either keep of remove.

skip

Skip the creation of of processor step. If TRUE, this step will not be added to the list of processing steps. Typically reserved for nested function calls.

Value

An updated version of collection.

Details

The upper limit in not included: [min, max).

Examples

library(tidySpectR) # Trimming one side mask(fa_nmr, from = Inf, to = 7.2)
#> Spectra collection containing 6 entries. #> Number of bins: 1801 #> Limits: -2.123166e-05 7.203979 #> Labels: conventional organic #> #> Processing: #> Step 1 / 1 : mask
# Masking region mask(fa_nmr, from = 3.5, to = 3, overlaps = 'remove')
#> Spectra collection containing 6 entries. #> Number of bins: 2124 #> Limits: -2.123166e-05 8.999979 #> Labels: conventional organic #> #> Processing: #> Step 1 / 1 : mask