Skip to contents

*️⃣ ChemoSpec

Usage

to_ChemoSpec(
  data,
  groups = "{missing group}",
  freq = base::as.numeric(base::colnames(data)),
  names = base::rownames(data),
  desc = "{missing description}",
  unit_frequency = "{missing frequency unit}",
  unit_intensity = "{missing intensity unit}",
  colors_set = ChemoSpecUtils::Col8,
  sym_set = ChemoSpecUtils::Sym8,
  alt.sym_set = base::letters,
  extra_data = NULL,
  .strict_extra_data_names = TRUE
)

Arguments

data

Numeric matrix with samples in rows and frequencies in cols.

groups

Factor with sample class assignments or single integer or string value. Length of factor must match nrow(data). A single value is treated as setting the same group for all samples. Defaults to "{missing group}"

freq

Numeric vector with unique frequencies. Length must match ncol(data). Defaults to colnames(data) cast as.numeric().

names

Character vector with unique sample names. Length must match nrow(data). Defaults to rownames(data).

desc

Optional description for plots generated with ChemoSpec.

unit_frequency, unit_intensity

Optional labels for the x- and y-axis.

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.

extra_data

Optional data frame with samples in rows and additional per-sample data in its columns. colnames() of extra_data is used to obtain names which will be used as names() on the Spectra object.

.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 ChemoSpec::Spectra() object.