powered by
Calculate correlations and variances, including when x or y is an rvec.
x
y
var(x, y = NULL, na.rm = FALSE, use)
An rvec, if x or y is an rvec. Otherwise typically a numeric vector or matrix.
A numeric vector, matrix, data frame, or rvec().
rvec()
NULL (default) or a vector, matrix, data frame, or rvec with compatible dimensions to x.
Whether NAs removed before calculations.
NA
Calculation method. See stats::var().
stats::var()
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().
sd()
x <- rvec(cbind(rnorm(10), rnorm(10, sd = 20))) x var(x)
Run the code above in your browser using DataLab