adj_res()
and conform_res()
are helper functions to align
wavenumbers in terms of their spectral resolution.
adj_neg()
converts numeric intensities y
< 1 into values >= 1,
keeping absolute differences between intensity values by shifting each value
by the minimum intensity.
make_rel()
converts intensities y
into relative values between
0 and 1 using the standard normalization equation.
If na.rm
is TRUE
, missing values are removed before the
computation proceeds.
adj_res(x, res = 1, fun = round)conform_res(x, res = 5)
adj_neg(y, na.rm = FALSE)
mean_replace(y, na.rm = TRUE)
is_empty_vector(x)
adj_res()
and conform_res()
return a numeric vector with
resolution-conformed wavenumbers.
adj_neg()
and make_rel()
return numeric vectors
with the normalized intensity data.
a numeric vector or an R object which is coercible to one by
as.vector(x, "numeric")
; x
should contain the spectral
wavenumbers.
spectral resolution supplied to fun
.
the function to be applied to each element of x
; defaults
to round()
to round to a specific resolution res
.
a numeric vector containing the spectral intensities.
logical. Should missing values be removed?
Win Cowger, Zacharias Steinmetz
adj_res()
and conform_res()
are used in Open Specy to
facilitate comparisons of spectra with different resolutions.
adj_neg()
is used to avoid errors that could arise from log
transforming spectra when using adj_intens()
and other
functions.
make_rel()
is used to retain the relative height proportions between
spectra while avoiding the large numbers that can result from some spectral
instruments.
adj_res(seq(500, 4000, 4), 5)
conform_res(seq(500, 4000, 4))
adj_neg(c(-1000, -1, 0, 1, 10))
make_rel(c(-1000, -1, 0, 1, 10))
Run the code above in your browser using DataLab