

   matmult {base}                               R Documentation

   MMaattrriixx MMuullttiipplliiccaattiioonn

   DDeessccrriippttiioon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Ussaaggee::

        a%*%b

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

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

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

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

   EExxaammppllees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

