ir_new_ir {ir}R Documentation

Creates an object of class ir

Description

ir_new_ir is the constructor function for objects of class ir. An object of class ir is a tibble::tbl_df() with a sample in each row and a list column containing spectra for each sample.

Usage

ir_new_ir(spectra, metadata = tibble::tibble())

Arguments

spectra

A named list in which each element contains spectral data for one measurement. Each list element must be a data.frame with two columns and a row for each wavenumber value in the spectra data. The first column must contain unique wavenumber values and the second column intensity values of the measured spectrum of the sample.

metadata

An optional data.frame with additional columns containing metadata for the spectra in spectra. Optionally, an empty data.frame can be defined if no metadata are available.

Value

An object of class ir with the following columns:

spectra

A list column identical to spectra.

...

Additional columns contained in metadata.

Examples

ir_new_ir(
  spectra = ir_sample_data$spectra,
  metadata = ir_sample_data %>% dplyr::select(-spectra)
)


[Package ir version 0.2.1 Index]