

   CCoovvaarriiaannccee MMaattrriicceess

        var(x, y=x, na.rm=FALSE, use)

   AArrgguummeennttss::

          x: a matrix or vector.

          y: a matrix or vector.

      na.rm: logical.

        use: an optional character string giving a method for
             computing covariances in the presence of missing
             values.  This must be one of `"all.obs"', `"com-
             plete.obs"' or `"pairwise.complete.obs"', with
             abbreviation being permited.

   DDeessccrriippttiioonn::

        `var' computes the variance of `x' and the covariance
        of `x' and `y' if `x' and `y' are vectors. If `x' and
        `y' are matrices then the covariance between the
        columns of `x' and the the columns of `y' are computed.

        If `na.rm' is `TRUE' then the complete observations
        (rows) are use to compute the variance.  If `na.rm' is
        `FALSE' and there are missing values, then `var' will
        fail.

        The argument `use' can also be used for describing how
        to handle missing values.  Specifying `use="all"' is
        equivalent to specifying `na.rm=FALSE' and specifying
        `use="pair"' is equivalent to `na.rm=TRUE'.  If
        `use="pair"', then all the observations which are com-
        plete for a pair of variables is used to compute the
        covariance for that pair of variables.  This can result
        in covariance matrices which are not positive semidefi-
        nite.

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

        var(1:10)
        # 9.166667

        var(1:5,1:5)
        # 2.5

