# Scale: Scale a matrix-like object

## Description

Scales the columns of a numeric matrix.## Usage

Scale(X, type = c("standardize", "normalize", "none"))

## Arguments

type

The scaling type. See details.

## Details

This function is similar to `scale`

in `base`

package, but it can also
normalize the columns of a matrix. Suppose $x$ is one of the columns
in matrix `X`

. The "`standardize`

" is defined as
$$standardize = (x - mean(x))/sd(x)$$
and the "`normalize`

" is defined as
$$normalize = (x - min(x))/(max(x) - min(x)).$$
The "`none`

" is just to keep the original values. It is designed for the
`grpss`

function in purpose.## Examples

x <- matrix(1:18, ncol = 3)
Scale(x) # standardization
Scale(x, type = "normalize") # normalization
Scale(x, type = "none") # do nothing