powered by
Drop-in replacement for cor() that defaults to use = "pairwise.complete.obs".
cor()
use = "pairwise.complete.obs"
cor( x, y = NULL, use = "pairwise.complete.obs", method = c("pearson", "kendall", "spearman"), ... )
A correlation matrix or single correlation coefficient.
A numeric vector, matrix, or data frame.
Optional. A numeric vector, matrix, or data frame.
Method for handling missing values. Default "pairwise.complete.obs".
"pairwise.complete.obs"
Correlation method: "pearson", "kendall", or "spearman".
Additional arguments passed to stats::cor().
stats::cor()
x <- c(1, 2, NA, 4) y <- c(2, 4, 6, 8) cor(x, y)
Run the code above in your browser using DataLab