AddPlottingStuff: Add plotting variables

View source: R/AddPlottingStuff.R

AddPlottingStuffR Documentation

Add plotting variables

Description

This functions adds a few variables which make plotting features easier (and more informative). Since for example every peaks keeps it original ppm value, if you want to plot the groups this function adds the group ppm value. Also sample labels can be added.

Usage

AddPlottingStuff(Y.peaks, X.ppm = NULL, groupLabels = NULL)

Arguments

Y.peaks

data frame obtained from either of the 'getWaveletPeaks', 'PeakAligner' or 'PeakFilling' function.

X.ppm

The vector with the ppm values (numeric vector).

groupLabels

The groupLabels (numeric or factor).

Value

Returns a data frame with added plotting variables (groupPPM for aligned features and labels for plotting).

Author(s)

Charlie Beirnaert, charlie.beirnaert@uantwerpen.be

Examples

subset <- GetWinedata.subset()
subset.spectra = as.matrix(subset$Spectra)
subset.ppm = as.numeric(subset$PPM)

test.peaks <- getWaveletPeaks(Y.spec=subset.spectra, 
                              X.ppm=subset.ppm,
                              nCPU = 1) # nCPU set to 2 for the vignette build
                              
test.peaks.plot = AddPlottingStuff(test.peaks, subset.ppm, subset$Color)
#head(test.peaks.plot)


speaq documentation built on May 23, 2022, 5:06 p.m.