\HeaderA{genescale}{Scales a matrix or vector.}{genescale}
\keyword{manip}{genescale}
\begin{Description}\relax
\code{genescale} returns a scaled version of the input matrix m by applying
the following formula to each column of the matrix:
{    y[i] = ( x[i] - min(x) ) / ( max(x) - min(x) ) }
\end{Description}
\begin{Usage}
\begin{verbatim}
genescale(m, axis=2, method=c("Z", "R"), na.rm=TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{m}] Input a matrix or a vector with numeric elements. 
\item[\code{axis}] An integer indicating which axis of \code{m} to scale.
\item[\code{method}] Either "Z" or "R", indicating whether a Z scaling or a
range scaling should be performed.
\item[\code{na.rm}] A boolean indicating whether \code{NA}'s should be
removed.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Either the rows or columns of \code{m} are scaled. This is done either
by subtracting the mean and dividing by the standard deviation ("Z")
or by subtracing the minimum and dividing by the range.
\end{Details}
\begin{Value}
A scaled version of the input.
If \code{m} is a \code{matrix} or a \code{dataframe} then the
dimensions of the returned value agree with that of \code{m},
in both cases the returned value is a \code{matrix}.
\end{Value}
\begin{Author}\relax
R. Gentleman
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{genefinder}{genefinder}},\code{\LinkA{scale}{scale}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  m <- matrix(1:12, 4, 3)
  genescale(m)
\end{ExampleCode}
\end{Examples}


