specnames | R Documentation |
Retrieve or set the specnames of a colorSpec object. Retrieve the number of spectra.
## S3 method for class 'colorSpec'
specnames(x)
## S3 replacement method for class 'colorSpec'
specnames(x) <- value
## S3 method for class 'colorSpec'
numSpectra(x)
x |
a colorSpec R object |
value |
a character vector with length equal to the number of spectra in |
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)
.
specnames()
returns a character vector with the names of the spectra.
numSpectra(x)
is equal to length(specnames(x))
but much more efficient.
rownames
, colnames
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.