col01scale: Matrix Scaling Utilities

Description Usage Arguments Value Author(s) See Also Examples

View source: R/misc-goodies.R

Description

col01scale and colcenter (re)scale the columns of a matrix. These are simple one-line utilities, mainly with a didactical purpose.

Usage

1
2
colcenter (mat)
col01scale(mat, scale.func = function(x) diff(range(x)), location.func = mean)

Arguments

mat

numeric matrix, to rescaled.

scale.func, location.func

two functions mapping a numeric vector to a single number.

Value

a matrix with the same attributes as the input mat.

Author(s)

Martin Maechler

See Also

The standard R function scale().

Examples

1
2
3
4
5
## See the simple function definitions:

colcenter ## simply one line

col01scale# almost as simple

sfsmisc documentation built on June 8, 2017, 5:03 p.m.

Search within the sfsmisc package
Search all R packages, documentation and source code