

   SSccaalliinngg aanndd CCeenntteerriinngg ooff MMaattrriicceess

        scale(x, center=TRUE, scale=TRUE)

   AArrgguummeennttss::

          x: a numeric matrix.

     center: either a logical value or a numeric vector of
             length equal to the number of columns of `x'.

      scale: either a logical value or a numeric vector of
             length equal to the number of columns of `x'.

   DDeessccrriippttiioonn::

        The value of `center' determines how column centering
        is performed.  If `center' is a numeric vector with
        length equal to the number of columns of `x', then each
        column of `x' has the corresponding value from `center'
        subtracted from it.  If `center' is `TRUE' then center-
        ing is done by subtracting the column means of `x' from
        their corresponding columns and if `center' is `FALSE',
        no centering is done.

        The value of `scale' determines how column scaling is
        performed (after centering).  If `scale' is a numeric
        vector with length equal to the number of columns of
        `x', then each column of `x' is divided by the corre-
        sponding value from `scale'.  If `scale' is `TRUE' then
        scaling is done by dividing the (centered) columns of
        `x' by their root-mean-square, and if `scale' is
        `FALSE', no scaling is done.

        The root-mean-square for a column is obtained by com-
        puting the square-root of the sum-of-squares of the
        non-missing values in the column divided by the number
        of non-missing values minus one.

   VVaalluuee::

        The centered, scaled matrix.

   EExxaammpplleess::

        x <- matrix(1:10, nc=2)
        centered.x <- scale(x, scale=FALSE)
        centered.scaled.x <- scale(x)

