Var: Variance (and standard deviation) of a vector

View source: R/Var.R

Variance of a vectorR Documentation

Variance (and standard deviation) of a vector

Description

Variance (and standard deviation) of a vector.

Usage

Var(x, std = FALSE,na.rm = FALSE)

Arguments

x

A vector with data.

std

If you want the standard deviation set this to TRUE, otherwise leave it FALSE.

na.rm

TRUE or FAlSE for remove NAs if exists.

Details

This is a faster calculation of the usual variance of a matrix.

Value

The variance of the vector.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.

See Also

colVars, cova

Examples

x <- rnorm(100)
a1 <- Var(x)
a2 <- var(x)
x<-NULL

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.