ir_bin: Bins infrared spectra

View source: R/ir_bin.R

ir_binR Documentation

Bins infrared spectra

Description

ir_bin bins intensity values of infrared spectra into bins of a defined width or into a defined number of bins.

Usage

ir_bin(x, width = 10)

Arguments

x

An object of class ir with integer wavenumber values increasing by 1.

width

An integer value indicating the wavenumber width of each resulting bin. Must be set to NULL if n is specified.

Details

If the last bin contains fewer input values than the remaining bins, it will be dropped and a warning will be printed. If a wavenumber value exactly matches the boundary of a bin window, the respective intensity value will be assigned to both neighboring bins.

Value

An object of class ir where spectra have been binned.

Examples

x <-
   ir::ir_sample_data %>%
   ir_bin(width = 50)


ir documentation built on May 2, 2022, 5:06 p.m.