

scale {base}                                 R Documentation

_S_c_a_l_i_n_g _a_n_d _C_e_n_t_e_r_i_n_g _o_f _M_a_t_r_i_c_e_s

_U_s_a_g_e_:

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

_A_r_g_u_m_e_n_t_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_e_t_a_i_l_s_:

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

_V_a_l_u_e_:

     The centered, scaled matrix.

_S_e_e _A_l_s_o_:

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

_E_x_a_m_p_l_e_s_:

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

