step_measure_transmittance() creates a specification of a recipe step
that converts absorbance values to transmittance.
Usage
step_measure_transmittance(
recipe,
measures = NULL,
role = NA,
trained = FALSE,
skip = FALSE,
id = recipes::rand_id("measure_transmittance")
)Arguments
- recipe
A recipe object. The step will be added to the sequence of operations for this recipe.
- measures
An optional character vector of measure column names to process. If
NULL(the default), all measure columns will be processed.- role
Not used by this step since no new variables are created.
- trained
A logical to indicate if the step has been trained.
- skip
A logical. Should the step be skipped when baking?
- id
A character string that is unique to this step.
Details
This step applies the inverse Beer-Lambert law transformation:
$$T = 10^{-A}$$
where \(A\) is absorbance and \(T\) is transmittance.
The measurement locations are preserved unchanged.
See also
step_measure_absorbance() for the inverse transformation
Other measure-preprocessing:
step_measure_absorbance(),
step_measure_calibrate_x(),
step_measure_calibrate_y(),
step_measure_derivative(),
step_measure_derivative_gap(),
step_measure_emsc(),
step_measure_kubelka_munk(),
step_measure_log(),
step_measure_map(),
step_measure_msc(),
step_measure_normalize_istd(),
step_measure_osc(),
step_measure_ratio_reference(),
step_measure_snv(),
step_measure_subtract_blank(),
step_measure_subtract_reference()
Examples
library(recipes)
# Convert to absorbance then back to transmittance (round-trip)
rec <- recipe(water + fat + protein ~ ., data = meats_long) |>
update_role(id, new_role = "id") |>
step_measure_input_long(transmittance, location = vars(channel)) |>
step_measure_absorbance() |>
step_measure_transmittance() |>
prep()