Function to write the "normalized" attribute of an existing generic_spct object.
Usage
setNormalized(
x,
norm = FALSE,
norm.type = NA_character_,
norm.factors = NA_real_,
norm.cols = NA_character_,
norm.range = rep(NA_real_, 2),
verbose = getOption("verbose_as_default", default = FALSE)
)
setNormalised(
x,
norm = FALSE,
norm.type = NA_character_,
norm.factors = NA_real_,
norm.cols = NA_character_,
norm.range = rep(NA_real_, 2),
verbose = getOption("verbose_as_default", default = FALSE)
)
Arguments
- x
a generic_spct object.
- norm
numeric (or logical) Normalization wavelength (nanometres).
- norm.type
character Type of normalization applied.
- norm.factors
numeric The scaling factor(s) so that dividing the spectral values by this factor reverts the normalization.
- norm.cols
character The name(s) of the data columns normalized.
- norm.range
numeric The wavelength range used for normalization (nm).
- verbose
logical Flag enabling or silencing informative warnings.
Details
This function is used internally, although occasionally
users may want to use it to "pretend" that spectral data have not been
normalized. Use normalize()
methods to apply a normalization
and set the attributes accordingly. Function setNormalized()
only
sets the attributes that store the metadata corresponding to an already
applied normalization. Thus a trace of the transformations applied to
spectral data is kept, which currently is used to renormalize the spectra
when the quantity used for expression is changed with a conversion
function. It is also used in other packages like 'ggspectra' when
generating automatically axis labels. If x
is not a
generic_spct
object, x
is not modified.
Note
Passing a logical
as argument to norm
is deprecated
but accepted silently for backwards compatibility.
setNormalised()
is a synonym for this setNormalized()
method.
See also
Other rescaling functions:
fscale()
,
fshift()
,
getNormalized()
,
getScaled()
,
is_normalized()
,
is_scaled()
,
normalize()
,
setScaled()