Update Group Names in a Spectra or Spectra2D Object
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 |
|
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 |
if (checkForPackageWithVersion("ChemoSpec", "5.1")) { library("ChemoSpec") data(metMUD1) metMUD1a <- updateGroups(metMUD1) # reports old groups metMUD1a <- updateGroups(metMUD1, new.grps = c("C", "T")) } if (checkForPackageWithVersion("ChemoSpec2D", "0.3")) { library("ChemoSpec2D") data(MUD1) MUD1a <- updateGroups(MUD1, new.grps = c("control", "treatment")) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.