colorSpec (version 0.5-3)

specnames: specnames of a colorSpec object

Description

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

Usage

"specnames"(x) specnames(x) <- value
"numSpectra"(x)

Arguments

x
a colorSpec R object
value
a character vector with length equal to the number of spectra in x.

Value

specnames returns a character vector with the names of the spectra.numSpectra(x) is the same as length(specnames(x)) but much more efficient.

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).

See Also

rownames, colnames