Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

specnames

specnames of a colorSpec object


Description

Retrieve or set the specnames of a colorSpec object. Retrieve the number of spectra.

Usage

## S3 method for class 'colorSpec'
specnames(x)

## S3 replacement method for class 'colorSpec'
specnames(x) <- value

## S3 method for class 'colorSpec'
numSpectra(x)

Arguments

x

a colorSpec R object

value

a character vector with length equal to the number of spectra in x.

Details

If the organization of x is "vector" then x is a vector and value is a single string, which is stored as attr(x,'specname').

If the organization of x is "matrix", then x is a matrix and value is stored as colnames(x).

If the organization of x is "df.col", then x is a data.frame with N+1 columns, where N is the number of spectra. value is stored as colnames(x)[2:(N+1)].

If the organization of x is "df.row", then x is a data.frame and value is stored as row.names(x).

Value

specnames() returns a character vector with the names of the spectra.

numSpectra(x) is equal to length(specnames(x)) but much more efficient.

See Also


colorSpec

Color Calculations with Emphasis on Spectral Data

v1.2-1
GPL (>= 3)
Authors
Glenn Davis [aut, cre]
Initial release
2020-04-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.