Learn R Programming

photobiology (version 0.11.3)

rmDerivedSpct: Remove "generic_spct" and derived class attributes.

Description

Removes from a spectrum object the class attributes "generic_spct" and any derived class attribute such as "source_spct". This operation is done by reference!

Usage

rmDerivedSpct(x, keep.classes = NULL)

Value

A character vector containing the removed class attribute values. This is different to the behaviour of function unlist in base R!

Arguments

x

an R object.

keep.classes

character vector Names of classes to keep. Can be used to retain base class "generic_spct".

Details

This function alters x itself by reference. If x is not a generic_spct object, x is not modified. This function behaves similarly to setdiff() but preserving the original order of the character vector of the S3 class names.

See Also

Other set and unset spectral class functions: setGenericSpct()

Examples

Run this code
my.spct <- sun.spct
removed <- rmDerivedSpct(my.spct)
removed
class(sun.spct)
class(my.spct)

Run the code above in your browser using DataLab