Centers and scales the columns of a matrix robustly
scale_med(mat, TOL = 1e-08, drop_const = TRUE, doRows = FALSE)The input matrix with its columns centered and scaled.
A numeric matrix. Its columns will be centered and scaled.
Columns with MAD below this value will be considered constant.
Default: 1e-8
Drop constant columns? Default: TRUE. If
FALSE, set to NA instead.
Center and scale the rows instead? Default: FALSE.
Centers each column on its median, and scales each column by its median
absolute deviation (MAD). If there are constant-valued columns, they are
removed if drop_const or set to NA if !drop_const, and
a warning is raised. If all columns are constant, an error is raised.