ggspectra (version 0.3.1)

find_idfactor: Find 'idfactor'

Description

Find if an 'idfactor' is present and needed in the plot and assemble a suitable plot layer to handle it.

Usage

find_idfactor(spct, idfactor, annotations, ...)

Arguments

spct

generic_spct or derived object

idfactor

character Name of an index column in data holding a factor with each spectrum in a long-form multispectrum object corresponding to a distinct spectrum. If idfactor=NULL the name of the factor is retrieved from metadata or if no metadata found, the default "spct.idx" is tried. If idfactor=NA no aesthetic is mapped to the spectra and the user needs to use 'ggplot2' functions to manually map an aesthetic or use facets for the spectra.

annotations

a character vector.

...

currently not used.

Value

A list object containing a list of ggplot components and a vector of annotations names as members.