Skip to contents

Robust Scale A variant of 'scale' that is based on median and mad (instead of mean and sd). It can handle zero variance without producing nan:s.

Usage

scale_robust(x, th = .Machine$double.eps)

Arguments

x

the vector/matrix to normalise

th

threshold for the scale being zero

Value

scaled_x (with attributes "scaled:center" and "scaled:scale")