extract extracts a spectral region

extract(x, ...)

# S3 method for collection
extract(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 extract. Use -Inf or Inf to extract up to an end of 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) # Removing edges extract(fa_nmr, from = 7.2, to = -0.5)
#> Spectra collection containing 6 entries. #> Number of bins: 1801 #> Limits: -2.123166e-05 7.203979 #> Labels: conventional organic #> #> Processing: #> Step 1 / 1 : extract