Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Var

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@yahoo.gr> and Manos Papadakis <papadakm95@gmail.com>.

See Also

Examples

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

Rfast

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.