specnames: specnames of a colorSpec object

View source: R/colorSpec.R

specnamesR Documentation

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

rownames, colnames


colorSpec documentation built on May 29, 2024, 6 a.m.