Last data update: 2014.03.03

R: Correlation Distance
dcorR Documentation

Correlation Distance

Description

dcor computes and returns the Correlation distance matrix between the rows of a data matrix. This distance is defined by d=√{1-r}.

Usage

dcor(x)

Arguments

x

a numeric matrix.

Value

A dist object with distance information.

Author(s)

Itziar Irigoien itziar.irigoien@ehu.es; Konputazio Zientziak eta Adimen Artifiziala, Euskal Herriko Unibertsitatea (UPV-EHU), Donostia, Spain.

Conchita Arenas carenas@ub.edu; Departament d'Estadistica, Universitat de Barcelona, Barcelona, Spain.

References

Gower, J.C. (1985). Measures of similarity, dissimilarity and distance. In: Encyclopedia of Statistical Sciences, volume 5, 397–405. J. Wiley and Sons.

See Also

dist, dmahal, dgower, dbhatta, dproc2

Examples

#Generate 10 objects in dimension 8
n <- 10
mu <- sample(1:10, 8, replace=TRUE)
x <- matrix(rnorm(n*8, mean=mu, sd=1), nrow=n, byrow=TRUE)


# Correlation distances between pairs 
d <- dcor(x)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ICGE)
Loading required package: MASS
Loading required package: cluster
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ICGE/dcor.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dcor
> ### Title: Correlation Distance
> ### Aliases: dcor
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> #Generate 10 objects in dimension 8
> n <- 10
> mu <- sample(1:10, 8, replace=TRUE)
> x <- matrix(rnorm(n*8, mean=mu, sd=1), nrow=n, byrow=TRUE)
> 
> 
> # Correlation distances between pairs 
> d <- dcor(x)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>