View source: R/spectrace_classify_clusters.R
spectrace_classify_clusters | R Documentation |
This function classifies (groups) of spectra by first aggregating the data and then correlating the aggregated spectra to reference spectra, identifying the best matching reference spectra.
spectrace_classify_clusters(
lightData,
referenceData = NULL,
aggregation = c("median", "mean"),
method = c("correlation"),
n.classes = 5,
return.spectra = TRUE
)
lightData |
(Grouped) data frame containing the (calibrated) light data. Data needs
to be in wide format (see |
referenceData |
(Optional) data frame containing the reference spectra. Needs to
contain the same wavelength columns as 'lightData'. Must consist of unique
spectra and must contain a column named 'spectrum_id' identifying each
spectrum. If not provided, the in-built reference spectra are used (see
|
aggregation |
Aggregation method. Must be one of ['median', 'mean']. Defaults to 'median'. |
method |
Classification method. Must be one of ['correlation']. Defaults to 'correlation'. |
n.classes |
Integer indicating the number of predicted classes per group to include in the output. Defaults to 5. |
A data frame with the best 'n.classes' classifications (i.e. the 'spectrum_id') and corresponding coefficients per group.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.