Description Usage Arguments Value Examples
This function is based on the function stats::cor
.
For cor.zoo
and cor.zoocat
, the equality of the index
of x
and y
will be checked (if y
is not NULL
).
For cor.zoocat
, if y
has one column, the result will be binded with the
cattr table and a data frame will be returned.
1 2 3 4 5 6 7 |
x |
A |
y |
NULL or a |
... |
Other arguments for function |
a vector, matrix or data frame.
1 2 3 4 5 6 7 8 9 10 | x <- zoo(c(1, 3, 2, 4, 5))
y <- zoo(c(12, 30, 2, 46, 5))
cor(x, y)
x <- matrix(1 : 20, nrow = 5)
colAttr <- data.frame(month = c(2, 3, 5, 6), name = 'x')
zc <- zoocat(x, order.by = 1991 : 1995, colattr = colAttr)
y <- zoo(c(3, 5, 4, 6, 3), order.by = 1991 : 1995)
cor(zc, y, method = 'kendall')
cor(zc, method = 'kendall')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.