Mirrors the C# Correlation class of the Numerics library: the paired-vector forms
(Correlation.Pearson/Spearman/KendallsTau, both IList<double> overloads) and the
Pearson/Spearman column-pairwise matrix overloads (Pearson(double[,])/Spearman(double[,])).
Usage
correlation(x, y = NULL, method = c("pearson", "spearman", "kendall"))Arguments
- x
a numeric vector (paired-vector form,
yrequired), or a numeric matrix or data frame (matrix form,yomitted) with one column per variable.- y
a numeric vector of the same length as
x, orNULL(the default) to compute the correlation matrix ofx's columns instead.- method
one of
"pearson"(the default),"spearman", or"kendall"."kendall"is rejected whenyisNULL: upstream has noKendallsTau(double[,])overload, so there is no Kendall matrix form to compute.