Retrieve or set the specnames of a colorSpec object. Retrieve the number of spectra.
# S3 method for colorSpec
specnames(x)# S3 method for colorSpec
specnames(x) <- value
# S3 method for colorSpec
numSpectra(x)
specnames()
returns a character vector with the names of the spectra.
numSpectra(x)
is equal to length(specnames(x))
but much more efficient.
a colorSpec R object
a character vector with length equal to the number of spectra in x
.
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)
.