Skip to contents

This function tests a generic_spct object for an attribute that signals whether the spectral data has been normalized or not after the object was created.

Usage

is_normalized(x)

is_normalised(x)

Arguments

x

An R object.

Value

A logical value indicating if x is normalized or not, for collections of spectra, a named list with logicals as members. If x is not a generic_spct or generic_mspct object the value returned is NA.

Note

While method getNormalized() returns in some cases numeric values or possibly even character values if stored in attribute normalized, is_normalized() always returns a logical value and can be safely used in conditional code clauses.

is_normalised() is another name for is_normalized().

Examples

norm_sun.spct <- normalize(sun.spct)
is_normalized(norm_sun.spct)
#> [1] TRUE

norm_sun_evening.mspct <- normalize(sun_evening.mspct[1:3])
str(is_normalized(norm_sun_evening.mspct))
#> List of 3
#>  $ time.01: logi TRUE
#>  $ time.02: logi TRUE
#>  $ time.03: logi TRUE
#>  - attr(*, "comment")= chr "Applied function: 'is_normalized'.\n"