View source: R/applicability_domain.R
| predict.specproc_domain | R Documentation |
Computes Hotelling's T^2 and the Q residual of new spectra in the
PCA model of applicability_domain(), and flags those outside the
domain.
## S3 method for class 'specproc_domain'
predict(object, newdata, ...)
object |
The result of |
newdata |
The new spectra: a numeric matrix or data frame with the variables of the calibration spectra. |
... |
Not used. |
A tibble of class specproc_influence, as returned by
q_residuals(), with one row per spectrum: sample, t2 and its
limit, q and its limit, outlier ("regular", "extreme" for a high
T^2, "residual" for a high Q, or "both"), and inside, whether
the spectrum lies inside the domain. Draw it with plot_influence().
applicability_domain()
data(forageLIBS)
wl <- suppressWarnings(as.numeric(names(forageLIBS)))
spectra <- as.matrix(forageLIBS[which(wl > 380 & wl < 430)])
domain <- applicability_domain(spectra[1:300, ])
flags <- predict(domain, spectra[301:368, ])
flags[!flags$inside, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.