Sxy | R Documentation |
Calculates the variation of one variable or the covariation of two different variables.
Sxy(x, y = x, na.rm = FALSE)
x |
vector of one variable. |
y |
vector of another variable (optional). If specified then the covariation of |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
The variaion of x
or the covariation of x
and y
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.