variance | R Documentation |
A hybrid of S-PLUS and R definitions of the variance function.
variance(x, na.rm=TRUE, unbiased=FALSE)
x |
a numeric |
na.rm |
a logical flag. If |
unbiased |
a logical flag. If |
Allows the user to calculate the biased/unbiased variance of the input and provides the option to eliminate NA values as well.
the sample variance of the input.
var
.
set.seed(100) x <- rnorm(100) variance(x, unbiased=TRUE) variance(x, unbiased=FALSE) variance(c(x,rep(NA,30)), na.rm=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.