Just like extraction and replacement with indexes for base R lists, but preserving the special attributes used in spectral classes.
# S3 method for generic_mspct
[(x, i, drop = NULL)# S3 method for generic_mspct
[(x, i) <- value
# S3 method for generic_mspct
$(x, name) <- value
# S3 method for generic_mspct
[[(x, name) <- value
Collection of spectra object from which to extract member(s) or in which to replace member(s)
Index specifying elements to extract or replace. Indices are numeric
or character vectors. Please, see Extract
for
more details.
If TRUE the result is coerced to the lowest possible dimension (see the examples). This only works for extracting elements, not for the replacement.
A suitable replacement value: it will be repeated a whole number of times if necessary and it may be coerced: see the Coercion section. If NULL, deletes the column if a single column is selected.
A literal character string or a name (possibly backtick quoted). For extraction, this is normally (see under 'Environments') partially matched to the names of the object.
An object of the same class as x
but containing only the
subset of members that are selected.
This method is a wrapper on base R's extract method for lists that sets additional attributes used by these classes.