R/ml_pipeline.R
morie_ml_scale.Rd
Scale a numeric vector by a target standard deviation
morie_ml_scale(x, scale = stats::sd(x, na.rm = TRUE))
Numeric vector.
Divisor (default the sample SD).
Scaled numeric vector, carrying a scale attribute.
scale
morie_ml_scale(1:5) #> [1] 0.6324555 1.2649111 1.8973666 2.5298221 3.1622777 #> attr(,"scale") #> [1] 1.581139