Converts absorbance spectra to transmittance spectra or vice versa
Source:R/ir_to_transmittance.R
ir_to_transmittance.Rd
ir_to_transmittance
converts absorbance spectra to transmittance
spectra. ir_to_absorbance
converts transmittance spectra to absorbance
spectra. Note that neither function checks whether the input spectra are
absorbance or transmittance spectra.
Arguments
- x
An object of class
ir
.
Value
x
with y values fore each spectrum as transmittance values
(in case of ir_to_transmittance
) or absorbance values (in case of
ir_to_absorbance
).
References
Stuart BH (2004). Infrared Spectroscopy: Fundamentals and Applications: Stuart/Infrared Spectroscopy: Fundamentals and Applications, Analytical Techniques in the Sciences. John Wiley \& Sons, Ltd, Chichester, UK. ISBN 978-0-470-01114-0 978-0-470-85428-0, doi:10.1002/0470011149 .
Examples
# convert from absorbance to transmittance
x1 <-
ir_sample_data %>%
ir_to_transmittance()
# convert from transmittance to absorbance
x2 <-
x1 %>%
ir::ir_to_absorbance()
vapply(
seq_along(x2$spectra),
FUN = function(i) all.equal(x2$spectra[[i]], ir::ir_sample_data$spectra[[i]]),
FUN.VALUE = logical(1L)
) %>%
all()
#> [1] TRUE