Skip to contents

Some data will not be converted:

  • Spectra columns except the spc_column

  • Wavenumber columns except the wavelength_column

Usage

simplerspec_to_hyperSpec(
  spc_tbl,
  spc_column = base::c("spc_pre", "spc_mean", "spc_rs", "spc"),
  wavelength_column = base::c("xvalues_pre", "wavenumbers_rs", "wavenumbers"),
  unit_spc = "{missing spectra unit}",
  unit_wavelength = "{missing wavelength unit}",
  .strict_column_check = TRUE,
  ...
)

Arguments

spc_tbl

simplerspec::gather_spc, simplerspec::resample_spc, simplerspec::average_spc, or simplerspec::preprocess_spc spectra tibble.

spc_column

Column name of the data to use. Must be one of "spc_pre", "spc_mean", "spc_rs", "spc", or any column name if strict_column_check is set to FALSE.

wavelength_column

Column name of the data to use. Must be one of "xvalues_pre", "wavenumbers_rs", "wavenumbers", or any column name if strict_column_check is set to FALSE.

unit_wavelength, unit_spc

Optional labels for the x- and y-axis.

.strict_column_check

(Default: TRUE) Set this to FALSE to allow using any valid column name on spc_tbl in spc_column and wavelength_column.

...

Arguments passed on to hyperSpec::hyperSpec

gc

(logical)
Use garbage collection. If the option gc is set to TRUE, the initialization will have frequent calls to base::gc(), which can help avoid swapping or running out of memory. The default value of gc can be set via hy_set_options().

Value

A ChemoSpec::Spectra() object.

Examples

if (FALSE) {
  data("simplerspec_opus")
  spectra <- simplerspec_to_hyperSpec(simplerspec_opus) |> str()
}