View source: R/prep_transform.R
| prep_transform | R Documentation |
Creates a preprocessing constructor for converting spectral data between
reflectance and absorbance. The constructor is intended to be passed to
preprocess_recipe and executed via process.
prep_transform(to = c("absorbance", "reflectance"))
to |
A character string specifying the target unit. Either
|
Conversion follows Beer's Law:
\mjdeqnA = -\log_10(R)A = -log10(R)
where \mjeqnAA is absorbance and \mjeqnRR is reflectance.
When converting to absorbance, all values in X must be strictly
positive. A warning is issued if the resulting absorbance contains small
negative values, which may indicate precision or scaling issues in the
input.
Note that no check is performed on whether the input is actually in the expected unit (the transformation is applied as specified).
An object of class preprocessing to be used in
preprocess_recipe and executed by process.
Leonardo Ramirez-Lopez
preprocess_recipe, process
data("proximateCannabis")
X <- proximateCannabis$spc # absorbance
tr <- prep_transform(to = "reflectance")
recipe <- preprocess_recipe(tr, device = "proxiscout")
X_ref <- process(X, recipe)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.