rscale: Robustly scale a numeric vector.

Description Usage Arguments Details

Description

Robustly scale a numeric vector.

Usage

1
rscale(x, center = TRUE, scale = TRUE, na.action = na.omit)

Arguments

x

A numeric vector.

center

Logical, whether to center using the median. Defauts to center = TRUE.

scale

Logical, whether to scale using the mad. Defaults to scale = TRUE.

na.action

What to do when there are missing values. Defaults to na.action=na.omit and missing values are returned in the same places as in x. The alternative is na.action=na.fail which will cause the funtion to fail if there are missing values.

Details

The vector will be centered by its median and then scaled by its median absolute deviation. There may be better (more efficient) ways of doing this (say by using M-estimators of location and scale), but for most cases, this approach ought to be fine.


harrysouthworth/conclus documentation built on May 24, 2019, 4:05 a.m.