Learn R Programming

photobiology (version 0.11.3)

getNormalized: Query the "normalized" and "normalization" attributes

Description

Functions to read the "normalized" and "normalization" attributes of an existing generic_spct object.

Usage

getNormalized(x, .force.numeric = FALSE)

getNormalised(x, .force.numeric = FALSE)

getNormalization(x)

getNormalisation(x)

Value

getNormalized() returns numeric or logical (possibly character for objects created with earlier versions); for collections of spectra, a named list, with one member for each spectrum. If x is not a

generic_spct object, NA or a list with fields set to NAs is returned. Objects created with versions of package 'photobiology' earlier than 0.10.8 are lacking the detailed normalization metadata.

getNormalization() returns a list with five fields: norm.type, norm.wl, norm.factors, norm.cols, norm.range. For collections of spectra, a named list of lists, with one member list for each member of the collection of spectra. See setNormalized() for the values stored in the fields.

Arguments

x

a generic_spct object.

.force.numeric

logical If TRUE always silently return a numeric value, with FALSE encoded as zero, and character values as NA.

Details

Spectral data that has been normalized needs to be used diffferently in computations than data expresed in original units. These two functions make it possible to query if data stored in an object of class generic_spct or of a derived class contains data expressed in physical units or normalized. In the later case, it is possible to also query how the normalization was done.

See Also

Other rescaling functions: fscale(), fshift(), getScaled(), is_normalized(), is_scaled(), normalize(), setNormalized(), setScaled()

Examples

Run this code

getNormalized(sun.spct)
getNormalization(sun.spct)

sun_norm.spct <- normalize(sun.spct)

getNormalized(sun_norm.spct)
getNormalization(sun_norm.spct)

getNormalization(e2q(sun_norm.spct))

gel_norm.spct <- normalize(yellow_gel.spct)

getNormalized(gel_norm.spct)
getNormalization(gel_norm.spct)

getNormalization(T2Afr(gel_norm.spct))
getNormalization(any2A(gel_norm.spct))

Run the code above in your browser using DataLab