merge_dts_l: Wrapper function around 'merge_dts()' for list of tibbles to...

View source: R/plot-spc-extended.R

merge_dts_lR Documentation

Wrapper function around merge_dts() for list of tibbles to aggregate data for plotting.

Description

Instead of a single spectral tibble (data frame) multiple spectral tibbles can be merged into a long-form data.table for plotting spectra and related data. For details, see merge_dts.

Usage

merge_dts_l(
  spc_tbl_l,
  lcols_spc = c("spc", "spc_pre"),
  lcol_measure = NULL,
  spc_id = "unique_id",
  group_id = "sample_id"
)

Arguments

spc_tbl_l

List of spectral tibbles (data frames).

lcols_spc

Character vector of spectral list-columns to be extracted. Default is c("spc", "spc_pre") (raw and preprocessed spectra).

lcol_measure

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.

spc_id

Character vector of column that contains a unique spectral identifier for all spectra. Default is "unique_id".

group_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.

Value

A single data.table containing long form aggregated data of spectra, x-axis values, metadata and an additionally measured variable. An additional column called group_id_tbl is appended. It denotes the name of the spectral tibble supplied with the list spc_tbl_l.


philipp-baumann/simplerspec documentation built on Oct. 3, 2023, 12:13 p.m.