Creates new bins delimited by the input breaks and sums up the intensity values within each bin.

bucket_from_breaks(x, ...)

# S3 method for collection
bucket_from_breaks(x, breaks, skip = FALSE, ...)

Arguments

x

Acollection object

...

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

breaks

A vector of breaking values

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

If omitted, the spectra limits will be added to the breaks.

Bins will be grouped considering their center, inclusion criteria is (lower_limit, higher_limit].

Examples

library(tidySpectR) breaks = c(10, 8, 7.5, 7, 5, 0, -1) bucket_from_breaks(fa_nmr, breaks)
#> Spectra collection containing 6 entries. #> Number of bins: 5 #> Limits: 0 8.999979 #> Labels: conventional organic #> #> Processing: #> Step 1 / 1 : cutsom_bucketting