Skip to contents

opusreader2 ⚪ ➡️ 🟠 ChemoSpec

Usage

opusreader2_to_ChemoSpec(
  opusreader2_list,
  groups,
  names,
  data_block = "ab",
  gc = hyperSpec::hy_get_option("gc"),
  ...
)

Arguments

opusreader2_list

A list_opusreader2.

groups

Factor with sample class assignments.

names

Character vector with unique sample names.

data_block

(Default: "ab") Data block to use from the opus files. If you aren't sure which data blocks are available in your data set, use .getDataBlockNames().

gc

See hyperSpec::hyperSpec().

...

Arguments passed on to to_ChemoSpec

unit_frequency,unit_intensity

Optional labels for the x- and y-axis.

desc

Optional description for plots generated with ChemoSpec.

colors_set,sym_set,alt.sym_set

Character vector with group colors, Numeric vector with group symbol numbers, Character vector with alternative group symbols. Their length must match at least the number of levels in groups. Groups are assigned colors based on their numeric factor level. Defaults to ChemoSpecUtils::Col8, ChemoSpecUtils::Sym8 and base::letters. A color-blind friendly palette is available in ChemoSpecUtils::Col7. Extended palettes are available at ChemoSpecUtils::Col12, ChemoSpecUtils::Sym12, and using other packages, like RColorBrewer.

.strict_extra_data_names

(Default: TRUE) Set this to FALSE to allow columns from extra_data to overwrite values on the Spectra object.

Value

A list of ChemoSpec::Spectra() objects.

Examples

if (FALSE) {
  data("opusreader2_list")
  spectra <- opusreader2_to_ChemoSpec(opusreader2_list, "A", 1:3 |> as.character()) |> str()
}