Learn R Programming

dbstats (version 1.0.4)

disttoD2: Distance conversion: dist to D2

Description

Converts dist or dissimilarity class object into D2 class object.

Usage

disttoD2(distance)

Arguments

distance

dist or dissimilarity class object. See functions dist in the package stats and daisy in the package cluster.

Value

An object of class D2 containing the squared distances matrix between individuals.

See Also

GtoD2 D2toG D2toDist

Examples

Run this code
# NOT RUN {
X <- matrix(rnorm(100*3),nrow=100)
distance <- daisy(X,"manhattan")
D2 <- disttoD2(distance)

# }

Run the code above in your browser using DataLab