slice_xvalues: Slice spectra into defined x-axis ranges

View source: R/slice-spc.R

slice_xvaluesR Documentation

Slice spectra into defined x-axis ranges

Description

Slice spectra contained in list-column of spectral tibble (data frame). A list of x-axis value ranges can be specified. Spectra are cut based on these ranges.

Usage

slice_xvalues(
  spc_tbl,
  xunit_lcol = "wavenumbers",
  spc_lcol = "spc",
  xvalues_cut = NULL
)

Arguments

spc_tbl

Spectral data in a tibble object (classes "tibble_df", "tbl" and "data.frame"). The spectra tibble is expected to contain at least the column spc (list-column with spectral matrices stored in a list) and wavenumbers or wavelengths (list-column that contains list of x-axis values).

xunit_lcol

Character vector that specifies column name where x-axis axis units are stored within spc_tbl. Default is "wavenumber".

spc_lcol

Character vector that specifies which column (list-column) contains spectra to be sliced. Default is "spc".

xvalues_cut

List of numeric vectors that contains upper and lower bounds of respective regions to keep in spectra. The spectral regions outside the xvalues_cut intervals will be cut out in the output spectra.

Value

Spectral tibble (data frame with list-columns) with sliced x-axis column and spectral column. Both the x-axis list-column and the spectral tibble list-column only contain data specified within the xvalues_cut argument (list of numeric vectors).


philipp-baumann/simplerspec documentation built on Oct. 3, 2023, 12:13 p.m.