ir_clip clips infrared spectra to a new, specified, wavenumber range
or multiple new specified wavenumber ranges.
Arguments
- x
An object of class
ir.- range
A
data.framewith two columns and a row for each wavenumber range to keep. The columns are:- start
A numeric vector with start values for wavenumber ranges.
- end
A numeric vector with end values for wavenumber ranges.
If
rangehas more than one row, multiple ranges are clipped fromxand merged together. Overlapping ranges are not allowed.- return_ir_flat
Logical value. If
TRUE, the spectra are returned asir_flatobject.
Examples
## clipping with one range
# define clipping range
range <-
data.frame(start = 900, end = 1000)
# clip
x <-
ir::ir_sample_data |>
ir::ir_clip(range = range)
## clipping with mutliple ranges
# define clipping range
range <-
data.frame(start = c(900, 1900), end = c(1000, 2200))
# clip
x <-
ir::ir_sample_data |>
ir::ir_clip(range = range)