var: Correlation, Variance, and Covariance Generics

Description Usage Arguments Note

Description

Generics for the var, cov, cor functions

Usage

1
2
3
4
5
6
7
var(x, y = NULL, na.rm = FALSE, use)

cov(x, y = NULL, use = "everything", method = c("pearson", "kendall",
  "spearman"))

cor(x, y = NULL, use = "everything", method = c("pearson", "kendall",
  "spearman"))

Arguments

x

a numeric vector, matrix or data frame.

y

NULL (default) or a vector, matrix or data frame with compatible dimensions to x. The default is equivalent to y = x (but more efficient).

na.rm

logical. Should missing values be removed?

use

an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs".

method

a character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman": can be abbreviated.

Note

Dispatches only on 'x' and 'y'


cdeterman/generics documentation built on May 20, 2019, 8:01 p.m.