diffDist {RFLPtools} | R Documentation |
Distance Matrix Computation
Description
This function computes and returns the distance matrix computed by
using the specified distance measure to compute the distances between
the rows of a data matrix. Instead of the row values as in the case of
dist
, the successive differences of the row values
are used.
Usage
diffDist(x, method = "euclidean", diag = FALSE, upper = FALSE, p = 2)
Arguments
x |
a numeric matrix, data frame or |
method |
the distance measure to be used. This must be one of
|
diag |
logical value indicating whether the diagonal of the
distance matrix should be printed by |
upper |
logical value indicating whether the upper triangle of the
distance matrix should be printed by |
p |
The power of the Minkowski distance. |
Details
This function computes and returns the distance matrix computed by
using the specified distance measure to compute the distances between
the rows of a data matrix. Instead of the row values as in the case of
dist
, the successive differences of the row values
are used.
It's a simple wrapper function arround dist
. For
more details about the distances we refer to dist
.
The function may be helpful, if there is a shift w.r.t.\ the measured
bands; e.g.\ c(550, 500, 300, 250)
vs.\ c(510, 460, 260, 210)
.
Value
diffDist
returns an object of class "dist"
; cf. dist
.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
References
Flessa, F., Kehl, A., Kohl, M. Analysing diversity and community structures using PCR-RFLP: a new software application. Molecular Ecology Resources 2013 Jul; 13(4):726-33.
Examples
## assume a shift in the measured bands
M <- rbind(c(550, 500, 300, 250), c(510, 460, 260, 210),
c(550, 500, 300, 200))
dist(M)
diffDist(M)