Learn R Programming

TRMF (version 0.1.5)

NormalizeMatrix: Matrix Scaling

Description

A function for normalizing (scaling and centering) a matrix.

Usage

NormalizeMatrix(X, method = c("standard", "robust", "range", "none"),
            type = c("global", "rowwise", "columnwise"), na.rm = TRUE)

Arguments

X

a numeric matrix(like object)

method

type of scaling to perform, standard centers with mean, and scales by sd(), robust centers with the median and scales by mad(,constant=1), range maps to [0-1] interval

type

how should normalization be applied. global scales and centers matrix by one value. columnwise and rowwise normalize each column or row separately.

na.rm

logical value, ignore NA values or not.

Value

The possibly centered and scaled matrix. Scaling and centering quantities are stored as attributes.

Details

Scaling and centering quantities are stored as attributes.

Examples

Run this code
# NOT RUN {
x = matrix(1:10, ncol = 2)
NormalizeMatrix(x)
# }

Run the code above in your browser using DataLab