ir_bin {ir}R 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)


[Package ir version 0.2.1 Index]