Some data will not be converted:
Spectra columns except the
data_columnWavenumber columns except the
freq_column
Usage
simplerspec_to_ChemoSpec(
spc_tbl,
groups = "{missing group}",
data_column = base::c("spc_pre", "spc_mean", "spc_rs", "spc"),
freq_column = base::c("xvalues_pre", "wavenumbers_rs", "wavenumbers"),
name_column = base::c("unique_id", "file_id", "sample_id", "sample_name"),
.name_column_collapse = NULL,
.strict_column_check = TRUE,
...
)Arguments
- spc_tbl
simplerspec::gather_spc,simplerspec::resample_spc,simplerspec::average_spc, orsimplerspec::preprocess_spcspectra tibble.- 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}"- data_column
Column name of the data to use. Must be one of
"spc_pre", "spc_mean", "spc_rs", "spc", or any column name ifstrict_column_checkis set to FALSE.- freq_column
Column name of the data to use. Must be one of
"xvalues_pre", "wavenumbers_rs", "wavenumbers", or any column name ifstrict_column_checkis set to FALSE.- name_column
Column name of the data to use. Must be one of
"unique_id", "file_id", "sample_id", "sample_name", or any metadata column name ifstrict_column_checkis set to FALSE.- .name_column_collapse
(Default: NULL) Optional string, that if set allows multiple metadata column names to be set in
name_column, causing them to be concatenated using.name_column_collapseas a separator. This can be used with.strict_column_check = FALSEto construct custom sample identifiers using other metadata such asrep_no.- .strict_column_check
(Default: TRUE) Set this to FALSE to allow using any valid column name on
spc_tblindata_columnandfreq_column, and any metadata column names inname_column.- ...
Arguments passed on to
to_ChemoSpecunit_frequency,unit_intensityOptional labels for the x- and y-axis.
descOptional description for plots generated with ChemoSpec.
colors_set,sym_set,alt.sym_setCharacter 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 toChemoSpecUtils::Col8,ChemoSpecUtils::Sym8andbase::letters. A color-blind friendly palette is available inChemoSpecUtils::Col7. Extended palettes are available atChemoSpecUtils::Col12,ChemoSpecUtils::Sym12, and using other packages, like RColorBrewer..strict_extra_data_names(Default: TRUE) Set this to FALSE to allow columns from
extra_datato overwrite values on theSpectraobject.
Value
A ChemoSpec::Spectra() object.
