matmult                 package:base                 R Documentation

_M_a_t_r_i_x _M_u_l_t_i_p_l_i_c_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Multiplies two matrices, if they are conformable. If one argument
     is a vector, it will be coerced to a either a row or column matrix
     to make the two arguments conformable. If both are vectors it will
     return the inner product.

_U_s_a_g_e:

     a%*%b

_V_a_l_u_e:

     The matrix product.  Use `drop' to get rid of

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

     `matrix', `Arithmetic', `diag'.

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

     x <- 1:4
     x%*%x # scalar ("inner") product (1 x 1 matrix)
     drop(.Last.value)# as scalar

     y <- diag(x)
     z <- matrix(1:12,ncol=3,nrow=4)
     y%*%z
     y%*%x
     x%*%z

