| 1 |
\name{col01scale} |
| 2 |
\alias{col01scale} |
| 3 |
\alias{colcenter} |
| 4 |
\title{Matrix Scaling Utilities} |
| 5 |
\description{ |
| 6 |
\code{col01scale} and \code{colcenter} (re)scale the columns of a |
| 7 |
matrix. These are simple one-line utilities, mainly with a didactical |
| 8 |
purpose. |
| 9 |
} |
| 10 |
\usage{ |
| 11 |
colcenter (mat) |
| 12 |
col01scale(mat, scale.func = function(x) diff(range(x)), location.func = mean) |
| 13 |
} |
| 14 |
\arguments{ |
| 15 |
\item{mat}{numeric matrix, to rescaled.} |
| 16 |
\item{scale.func, location.func}{two functions mapping a numeric |
| 17 |
vector to a single number.} |
| 18 |
} |
| 19 |
\value{ |
| 20 |
a matrix with the same attributes as the input \code{mat}. |
| 21 |
} |
| 22 |
\author{Martin Maechler} |
| 23 |
\seealso{The standard \R function \code{\link{scale}()}.} |
| 24 |
\examples{ |
| 25 |
## See the simple function definitions: |
| 26 |
|
| 27 |
colcenter ## simply one line |
| 28 |
|
| 29 |
col01scale# almost as simple |
| 30 |
} |
| 31 |
\keyword{array} |