crossprod                package:base                R Documentation

_M_a_t_r_i_x _C_r_o_s_s_p_r_o_d_u_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     Given matrices 'x' and 'y' as arguments, 'crossprod' returns their
     matrix cross-product. This is formally equivalent to, but faster
     than, the call 't(x) %*% y'.

_U_s_a_g_e:

     crossprod(x, y = NULL)

_A_r_g_u_m_e_n_t_s:

    x, y: matrices: 'y = NULL' is taken to be the same matrix as 'x'.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     '%*%' and outer product '%o%'.

_E_x_a_m_p_l_e_s:

     (z <- crossprod(1:4))    # = sum(1 + 2^2 + 3^2 + 4^2)
     drop(z)                  # scalar

