extract a subset of the spectra in a colorSpec object.
The subset can be specified by indexes, by a logical vector, or by a regular expression matching the
a colorSpec object
an integer vector, a logical vector, or a regular expression
additional arguments ignored
subset is an integer vector, each integer must be between 1 and M,
where M the number of spectra in
No duplicates are allowed.
The number of spectra returned is equal to
It is OK for the
length to be 0, in which case the function returns the empty subset.
subset is a logical vector, its length must be equal to M.
The number of spectra returned is equal to the number of
subset is a regular expression, the number of spectra returned is equal to
the number of
specnames(x) matched by the expression.
subset(x) returns a colorSpec object with the same
Exception: if the organization of
'vector' and the subset is empty,
then the returned object is a matrix with 0 columns.
subset() can also be used for re-ordering the spectra;
just set argument
subset to the desired permutation vector.
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.