Skip to contents

Functions to query if source_spct and response_spct objects contain photon-based or energy-based data.

Usage

is_photon_based(x)

is_energy_based(x)

Arguments

x

any R object

Value

is_photon_based returns a logical value, TRUE if its argument is a source_spct or a response_spct object that contains photon base data and FALSE otherwise, but returns NA for any other R object, including those belonging other generic_spct-derived classes.

is_energy_based returns a logical value, TRUE if its argument is a source_spct or a response_spct object that contains energy base data and FALSE otherwise, but returns NA for any other R object, including those belonging other generic_spct-derived classes

See also

Other query units functions: is_absorbance_based(), is_mole_based()

Examples

colnames(sun.spct)
#> [1] "w.length"  "s.e.irrad" "s.q.irrad"
is_photon_based(sun.spct)
#> [1] TRUE
my.spct <- sun.spct[ , c("w.length", "s.e.irrad")]
is.source_spct(my.spct)
#> [1] TRUE
is_photon_based(my.spct)
#> [1] FALSE

colnames(sun.spct)
#> [1] "w.length"  "s.e.irrad" "s.q.irrad"
is_energy_based(sun.spct)
#> [1] TRUE
my.spct <- sun.spct[ , c("w.length", "s.q.irrad")]
is.source_spct(my.spct)
#> [1] TRUE
is_energy_based(my.spct)
#> [1] FALSE