| predict.specproc_nas | R Documentation |
Computes the net analyte signal, selectivity and predicted concentration
of new samples with a model fitted by nas().
## S3 method for class 'specproc_nas'
predict(object, newdata, ...)
object |
An object returned by |
newdata |
A numeric matrix or data frame of new spectra, with the same variables as the calibration spectra. |
... |
Not used. |
A tibble with one row per new sample and columns nas,
selectivity, predicted and, if the model has a noise level, snr.
nas()
data(forageLIBS)
wl <- suppressWarnings(as.numeric(names(forageLIBS)))
spectra <- forageLIBS[which(wl > 760 & wl < 780)] # the K I resonance lines
cal <- 1:300
fit <- nas(spectra[cal, ], forageLIBS$K[cal], ncomp = 3)
head(predict(fit, spectra[-cal, ]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.