View source: R/resampling_FWHM.R
| resampling_FWHM | R Documentation |
It resample spectra data using Full Width Half Maximum (FWHM).
resampling_FWHM(spectra, wavelengths, new_wavelengths, FWHM, threads = 1L)
spectra |
A |
wavelengths |
A |
new_wavelengths |
A |
FWHM |
A |
threads |
An |
It returns a data.table with the resampled spectra, where columns
are the new bands and rows are samples. New bands whose FWHM window falls
partially outside the range of wavelengths are returned as NA.
J. Antonio Guzmán Q.
mean <- 50
sd1 <- 5
sd2 <- 10
n <- 100
test <- matrix(c(dnorm(1:n, mean = mean, sd = sd1),
dnorm(1:n, mean = mean, sd = sd2)),
nrow = 2,
byrow = TRUE)
current_bands <- 1:n
new_bands <- seq(10, 90, by = 5)
FHWM <- rep(5, length(new_bands))
resampling_FWHM(spectra = test,
wavelengths = current_bands,
new_wavelengths = new_bands,
FWHM = FHWM)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.