| conColScheme {ChemoSpec} | R Documentation |
This function permits you to change the color scheme of an existing
Spectra object.
conColScheme(spectra, old = levels(as.factor(spectra$colors)), new = NULL)
spectra |
An object of S3 class |
old |
A character vector of the old color names; will be searched for
and replaced one-for-one by the character vector in |
new |
A character vector of the new (replacement) color schemes. |
A grepping process is used. Depending upon the nature of the old color names to be searched for, you might need to add some grep pattern matching strings to the color name.
An object of S3 class Spectra whose color scheme has
been changed.
Bryan A. Hanson, DePauw University.
https://github.com/bryanhanson/ChemoSpec
For a discussion of general issues of color, see
colorSymbol.
data(metMUD1)
sumSpectra(metMUD1)
newSpec <- conColScheme(metMUD1, new = c("pink", "violet"))
sumSpectra(newSpec)