binning {ASICS} | R Documentation

## Binning/Bucketing of NMR spectra

### Description

Apply a binning function on a spectrum.

### Usage

    binning(spectra, bin = 0.01, exclusion.areas = matrix(c(4.5, 5.1), ncol =
      2), ncores = 1)

### Arguments

`spectra` | Data frame with spectra in columns and chemical shifts in rows. Colnames of this data frame correspond to pure metabolite names and rownames to chemical shift grid (in ppm).
`bin` | Numeric value specifying the bin width.
`exclusion.areas` | Definition domain of spectra that have to be excluded of the analysis (ppm). By default, the water region is excluded (4.5-5.1 ppm).
`ncores` | Number of cores used in parallel evaluation. Default to `1`.

### Value

A data frame with normalised spectra in columns and buckets in rows (bucket names correspond to the center of the bucket).

### Examples

    current_path <- file.path(system.file("extdata", package = "ASICS"),
                              "spectra_example.txt")
    spectra_data <- read.table(current_path, header = TRUE, row.names = 1)
    spectra_bin <- binning(spectra_data, bin = 0.01)

[Package ASICS version 1.0.1 Index]