conColScheme: Change the Color Scheme of a Spectra or Spectra2D Object

View source: R/conColScheme.R

conColSchemeR Documentation

Change the Color Scheme of a Spectra or Spectra2D Object

Description

This function permits you to change the color scheme of an existing Spectra or Spectra2D object.

Usage

conColScheme(spectra, new.cols = NULL, silent = FALSE)

Arguments

spectra

An object of S3 class ChemoSpec::Spectra() or ChemoSpec2D::Spectra2D().

new.cols

A character vector giving the new color values, of length(unique(spectra$colors)). If not provided, the function will print the old values for reference.

silent

Logical. If TRUE, suppresses all reporting.

Value

spectra An object of S3 class ChemoSpec::Spectra() or ChemoSpec2D::Spectra2D().

Author(s)

Bryan A. Hanson (DePauw University).

See Also

For a discussion of general issues of color, see colorSymbol.

Examples

if (checkForPackageWithVersion("ChemoSpec", 6.0)) {
  library("ChemoSpec")
  data(metMUD1)

  sumSpectra(metMUD1)
  newSpec <- conColScheme(metMUD1) # reports old colors
  newSpec <- conColScheme(metMUD1, new = c("pink", "violet"))
}

if (checkForPackageWithVersion("ChemoSpec2D", 0.5)) {
  library("ChemoSpec2D")
  data(MUD1)

  sumSpectra(MUD1)
  newSpec <- conColScheme(MUD1) # reports old colors
  newSpec <- conColScheme(MUD1, new = c("pink", "violet"))
}


ChemoSpecUtils documentation built on May 31, 2023, 5:56 p.m.