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

Description Usage Arguments Value See Also Examples

View source: R/conColScheme.R

Description

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

Usage

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

Arguments

spectra

An object of S3 class Spectra or 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 updated object of S3 class Spectra or Spectra2DSpectra2D.

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
if (checkForPackageWithVersion("ChemoSpec", "5.1")) {
  library("ChemoSpec")
  data(metMUD1)

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

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

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

ChemoSpecUtils documentation built on March 16, 2021, 1:08 a.m.