nmr_integrate_regions {AlpsNMR} | R Documentation

## Integrate regions

### Description

Integrate given regions and return a data frame with them

### Usage

    nmr_integrate_regions(samples, regions, ...)

    ## S3 method for class 'nmr_dataset_1D'
    nmr_integrate_regions(
      samples,
      regions,
      fix_baseline = TRUE,
      excluded_regions_as_zero = FALSE,
      set_negative_areas_to_zero = FALSE,
      ...
    )

### Arguments

`samples` | A nmr_dataset object
`regions` | A named list. Each element of the list is a region, given as a named numeric vector of length two with the range to integrate. The name of the region will be the name of the column
`...` | Keep for compatibility
`fix_baseline` | A logical. If `TRUE` it removes the baseline. See details below
`excluded_regions_as_zero` | A logical. It determines the behaviour of the integration when integrating regions that have been excluded. If `TRUE`, it will treat those regions as zero. If `FALSE` (the default) it will return NA values. If `fix_baseline` is `TRUE`, then the region boundaries are used to estimate a baseline. The baseline is estimated "connecting the boundaries with a straight line". Only when the spectrum is above the baseline the area is integrated (negative contributions due to the baseline estimation are ignored).
`set_negative_areas_to_zero` | A logical. Ignored if `fix_baseline` is `FALSE`. When set to `TRUE` negative areas are set to zero.

### Value

An nmr_dataset_peak_table object

### See Also

Other peak detection functions: `Pipelines`, `nmr_baseline_threshold()`, `nmr_identify_regions_blood()`, `nmr_identify_regions_cell()`, `nmr_identify_regions_urine()`, `regions_from_peak_table()`, `validate_nmr_dataset_peak_table()`

Other peak integration functions: `Pipelines`, `computes_peak_width_ppm()`, `nmr_identify_regions_blood()`, `nmr_identify_regions_cell()`, `nmr_identify_regions_urine()`, `validate_nmr_dataset_peak_table()`

Other nmr_dataset_1D functions: `[.nmr_dataset_1D()`, `computes_peak_width_ppm()`, `file_lister()`, `files_to_rDolphin()`, `format.nmr_dataset_1D()`, `is.nmr_dataset_1D()`, `load_and_save_functions`, `new_nmr_dataset_1D()`, `nmr_align_find_ref()`, `nmr_baseline_removal()`, `nmr_baseline_threshold()`, `nmr_exclude_region()`, `nmr_interpolate_1D()`, `nmr_meta_add()`, `nmr_meta_export()`, `nmr_meta_get_column()`, `nmr_meta_get()`, `nmr_normalize()`, `nmr_pca_build_model()`, `nmr_pca_outliers_filter()`, `nmr_pca_outliers_plot()`, `nmr_pca_outliers_robust()`, `nmr_pca_outliers()`, `nmr_ppm_resolution()`, `plot.nmr_dataset_1D()`, `plot_webgl()`, `print.nmr_dataset_1D()`, `rdCV_PLS_RF_ML()`, `rdCV_PLS_RF()`, `save_files_to_rDolphin()`, `to_ChemoSpec()`, `validate_nmr_dataset_peak_table()`, `validate_nmr_dataset()`

### Examples

    #Creating a dataset
    dataset <- new_nmr_dataset_1D(ppm_axis = 1:10,
                                  data_1r = matrix(sample(0:99,replace = TRUE), nrow = 10),
                                  metadata = list(external = data.frame(NMRExperiment = c("10",
                                  "20", "30", "40", "50", "60", "70", "80", "90", "100"))))

    # Integrating selected regions
    peak_table_integration = nmr_integrate_regions(
                                       samples = dataset,
                                       regions = list(ppm = c(2,5)),
                                       fix_baseline = TRUE)

    #Creating a dataset
    dataset <- new_nmr_dataset_1D(ppm_axis = 1:10,
                                  data_1r = matrix(sample(0:99,replace = TRUE), nrow = 10),
                                  metadata = list(external = data.frame(NMRExperiment = c("10",
                                   "20", "30", "40", "50", "60", "70", "80", "90", "100"))))

    # Integrating selected regions
    peak_table_integration = nmr_integrate_regions(
                                       samples = dataset,
                                       regions = list(ppm = c(2,5)),
                                       fix_baseline = TRUE)

[Package AlpsNMR version 3.0.6 Index]