

   scale {base}                                 R Documentation

   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

   UUssaaggee::

        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ettaaiillss::

        Center and/or scale the columns of a numeric matrix.

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

        The centered, scaled matrix.

   SSeeee AAllssoo::

        `sweep' which allows centering (and scaling) with arbi-
        trary statistics.

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

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

