Skip to contents

Scale a numeric vector by a target standard deviation

Usage

morie_ml_scale(x, scale = stats::sd(x, na.rm = TRUE))

Arguments

x

Numeric vector.

scale

Divisor (default the sample SD).

Value

Scaled numeric vector, carrying a scale attribute.

Examples

morie_ml_scale(1:5)
#> [1] 0.6324555 1.2649111 1.8973666 2.5298221 3.1622777
#> attr(,"scale")
#> [1] 1.581139