.BG
.FN scale
.TL
Scale Columns of a Matrix
.CS
scale(x, center=TRUE, scale=TRUE)
.AG x
matrix to be scaled.  Missing values (`NA's) are allowed.
.AG center
control over the value subtracted from each column.  If `TRUE',
the mean of (the non-missing data in)
each column is subtracted from the column.  If
given as a vector of length `ncol(x)', this vector is used;
i.e., `center[j]' is subtracted from column `j'.  If `FALSE',
no centering is done.
.AG scale
control over the value divided into each column to scale it.
If `TRUE' each column (after centering) is divided by
the square root of sum-of-squares over `n-1',
where `n' is the number of
of non-missing values.
If given as a vector of length `ncol(x)', column
`j' is divided by `scale[j]'.  If `FALSE', no scaling is done.
.RT
matrix like `x' with optional centering and scaling.
.PP
The default values of `center' and `scale'
produce columns with mean 0 and standard deviation 1.
.SA
`sweep'.
.EX
scale(x) #scale to correlation (0 mean, 1 std dev)
scale(x, center=apply(x,2,median), scale=FALSE)
    #remove column medians, do not scale
.KW array
.KW algebra
.WR
