Integrate given regions and return a data frame with them
nmr_integrate_regions(samples, regions, ...)
# S3 method for nmr_dataset_1D
nmr_integrate_regions(
samples,
regions,
fix_baseline = FALSE,
excluded_regions_as_zero = FALSE,
set_negative_areas_to_zero = FALSE,
...
)
A nmr_dataset object
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
A logical. If TRUE
it removes the baseline. See details
below
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).
A logical. Ignored if fix_baseline
is FALSE
.
When set to TRUE
negative areas are set to zero.
An nmr_dataset_peak_table object
Other peak detection functions:
Pipelines
,
nmr_baseline_threshold()
,
nmr_detect_peaks_plot_overview()
,
nmr_detect_peaks_plot()
,
nmr_detect_peaks_tune_snr()
,
nmr_detect_peaks()
,
nmr_identify_regions_blood()
,
nmr_identify_regions_cell()
,
nmr_identify_regions_urine()
Other peak integration functions:
Pipelines
,
get_integration_with_metadata()
,
nmr_identify_regions_blood()
,
nmr_identify_regions_cell()
,
nmr_identify_regions_urine()
,
nmr_integrate_peak_positions()
Other nmr_dataset_1D functions:
[.nmr_dataset_1D()
,
format.nmr_dataset_1D()
,
get_integration_with_metadata()
,
is.nmr_dataset_1D()
,
nmr_integrate_peak_positions()
,
nmr_meta_add()
,
nmr_meta_export()
,
nmr_meta_get_column()
,
nmr_meta_get()
,
nmr_ppm_resolution()
,
print.nmr_dataset_1D()
# 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))
)
# 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 = FALSE
)