corDist {SLmisc} | R Documentation |
The function computes and returns the correlation and absolute correlation distance matrix computed by using the specified distance measure to compute the distances between the rows of a data matrix.
corDist(x, method = "pearson", diag = FALSE, upper = FALSE, abs = FALSE, use = "pairwise.complete.obs")
x |
a numeric matrix or data frame |
method |
the correlation distance measure to be used. This must be one of
"pearson" , "spearman" , "kandall" or "cosine" .
Any unambiguous substring can be given. |
diag |
logical value indicating whether the diagonal of the distance matrix should be printed by 'print.dist'. |
upper |
logical value indicating whether the upper triangle of the distance matrix should be printed by 'print.dist'. |
abs |
logical, compute absolute correlation distances |
use |
character, correponds to argument use of function
cor |
The function computes the Pearson, Spearman, Kendall or Cosine sample correlation
and absolute correlation; confer Section 12.2.2 of Gentleman et al (2005). For more
details about the arguments we refer to functions dist
and
cor
.
'corDist' returns an object of class "dist"
; cf. dist
.
Dr. Matthias Kohl (SIRS-Lab GmbH) kohl@sirs-lab.com
Gentleman R. Ding B., Dudoit S. and Ibrahim J. (2005) Distance Measures in DNA Microarray Data Analysis. In: Gentleman R., Carey V.J., Huber W., Irizarry R.A. and Dudoit S. (editors) Bioinformatics and Computational Biology Solutions Using R and Bioconductor. Springer.
## only a dummy example M <- cor(matrix(rnorm(1000), ncol = 20)) D <- corDist(M)