Apply stored z-standardization to environmental predictors
Source:R/Processes_utils.R
apply_env_scaling.RdRe-applies the constants learned by compute_env_scaling() to env.
The transformation uses the stored mean/sd only and never recomputes them
from env, so calibration and prediction use an identical transformation
(the usual pitfall of scale() inside a model formula is avoided).
Arguments
- env
A
data.frame/data.tableof raw environmental data.- scaling
The
data.framereturned bycompute_env_scaling(), orNULL(in which caseenvis returned unchanged). For a model fit withenv_autoscale = TRUEthis ismodel$env_scaling.