var {rvec} | R Documentation |
Calculate correlations and variances, including when
x
or y
is an rvec.
var(x, y = NULL, na.rm = FALSE, use)
x |
A numeric vector, matrix, data frame, or |
y |
NULL (default) or a vector, matrix, data frame, or rvec with compatible dimensions to x. |
na.rm |
Whether |
use |
Calculation method. See |
To enable different behavior for rvecs and for ordinary vectors,
the base R function stats::var()
is turned into a generic,
with stats::var()
as the default.
For details on the calculations, see the documentation
for stats::var()
.
An rvec, if x
or y
is an rvec. Otherwise
typically a numeric vector or matrix.
x <- rvec(cbind(rnorm(10), rnorm(10, sd = 20)))
x
var(x)