powered by
Calculates the variation of one variable or the covariation of two different variables.
Sxy(x, y = x, na.rm = FALSE)
The variaion of x or the covariation of x and y.
x
y
vector of one variable.
vector of another variable (optional). If specified then the covariation of x and y is calculated. If omitted then the variation of x is calculated.
a logical value indicating whether NA values should be stripped before the computation proceeds.
x = c(1, 2) y = c(4, 1) Sxy(x) # variation Sxy(x, y) # covariation ## Second example illustrating the na.rm option x = c(1, 2, NA, 4) Sxy(x) Sxy(x, na.rm = TRUE)
Run the code above in your browser using DataLab