updateGroups | R Documentation |
A convenience function that can be used to update (change)
group names. The default group names come from the gr.crit
argument in the import functions files2SpectraObject
,
matrix2SpectraObject
or
files2Spectra2DObject
. In some cases gr.crit
may have complex regex patterns, and this function makes updating them to more
appropriate/more readible strings easier.
updateGroups(spectra, new.grps = NULL, silent = FALSE)
spectra |
An object of S3 class |
new.grps |
A vector of character values giving the new group names.
The new values must correspond to the order of the old values. This vector should
give the unique values only (so, it should have |
silent |
Logical. If |
spectra An object of S3 class ChemoSpec::Spectra()
or ChemoSpec2D::Spectra2D()
.
Bryan A. Hanson (DePauw University).
if (checkForPackageWithVersion("ChemoSpec", 6.0)) {
library("ChemoSpec")
data(metMUD1)
metMUD1a <- updateGroups(metMUD1) # reports old groups
metMUD1a <- updateGroups(metMUD1, new.grps = c("C", "T"))
}
if (checkForPackageWithVersion("ChemoSpec2D", 0.5)) {
library("ChemoSpec2D")
data(MUD1)
MUD1a <- updateGroups(MUD1, new.grps = c("control", "treatment"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.