if (FALSE) {
library(visa)
data(NSpec.DF)
x <- NSpec.DF$N # nitrogen
# Below resamples spectra to 20 nm for fast computation
S <- NSpec.DF$spectra[, seq(1, ncol(NSpec.DF$spectra), 20)]
# S is a spectral data object and x is a numeric vector.
Rsq3 <- cm.rbd3(S, x, cm.plot = TRUE)
}
Run the code above in your browser using DataLab