R/plot-spc-extended.R
merge_dts.RdHelper function that merges all spectra and related data into a single long form data.table than can subsequently be used for plotting.
merge_dts(
spc_tbl,
lcols_spc = c("spc", "spc_pre"),
lcol_measure = NULL,
spc_id = "unique_id",
group_id = "sample_id"
)Tibble data frame containing spectra, x-axis values, metadata and eventual measured variables as list-columns.
Character vector of spectral list-columns to be extracted.
Default is c("spc", "spc_pre") (raw and preprocessed spectra).
Character vector of length 1 denoting the column name
of the measure columns. This argument is optional. Default is NULL,
which does not extract an additional measure column.
Character vector of column that contains a unique spectral
identifier for all spectra. Default is "unique_id".
Character vector of columns that is used assigning spectra
into groups. Default is "sample_id". The group_id can be
used for later plotting and thereby visually separating spectral groups into
using different colors or panels.
A single data.table containing long form aggregated data of spectra, x-axis values, metadata and an additionally measured variable.