Learn R Programming

agricolae (version 1.0-1)

cor.matrix: Analysis of correlation. Methods of Pearson, Spearman and Kendall

Description

Obtains the coefficients of correlation and p-value between all the variables of a data table. The methods to apply are Pearson, Spearman and Kendall. Default is Pearson. Results similar to SAS.

Usage

cor.matrix(table, method = c("pearson", "kendall", "spearman")
,alternative="two.sided")

Arguments

table
Variables from correlation. A data frame.
method
"pearson", "kendall", "spearman"
alternative
"two.sided", "less", "greater"

Value

  • tableNumeric

Details

Parameters equal to function cor()

References

Experimental field

See Also

cor.vector, cor.mv, correl

Examples

Run this code
library(agricolae)
data(soil)
correlation<-cor.matrix(soil[,-1],method="pearson")
as.dist(correlation$correlation)
as.dist(correlation$pvalue)

Run the code above in your browser using DataLab