scale_med: Scale data columns robustly

Description Usage Arguments Details Value

View source: R/utils.R

Description

Centers and scales the columns of a matrix robustly for the purpose of covariance estimation.

Usage

1
scale_med(mat)

Arguments

mat

A numerical matrix.

Details

Centers each column on its median, and scales each column by its median absolute deviation (MAD). If any column MAD is zero, its values become zero and a warning is raised. If all MADs are zero, an error is raised.

Value

The input matrix with its columns centered and scaled.


neuroconductor/fMRIscrub documentation built on Dec. 22, 2021, 1:10 a.m.