Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

Arguments

x

an R object.

keep.classes

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

Value

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

Note

If x is an object of any of the spectral classes defined in this package, this function changes by reference the spectrum object into the underlying data.frame object. Otherwise, it just leaves x unchanged.

This function alters x itself by reference. If x is not a generic_spct object, x is not modified.

See Also

Other set and unset spectral class functions: setGenericSpct()

Examples

my.spct <- sun.spct
removed <- rmDerivedSpct(my.spct)
removed
class(sun.spct)
class(my.spct)

photobiology

Photobiological Calculations

v0.10.10
GPL (>= 2)
Authors
Pedro J. Aphalo [aut, cre] (<https://orcid.org/0000-0003-3385-972X>), Titta K. Kotilainen [ctb] (<https://orcid.org/0000-0002-2822-9734>), Glenn Davis [ctb], Agnese Fazio [ctb]
Initial release
2022-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.