## A five point equidistant transect:
n <- 5
x <- (n - 1)*seq(0, 1, length.out=n)
## The symmetric (Euclidean metric) function is obtained by calling
## the generator function with not arguments as follows:
mSym <- genDistMetric()
## The pairwise symmetric metric between the rows of x:
mSym(x)
## A second set of points in the same range as the previous one, but at a
## distance of 0.05 from one another:
xx <- (n - 1)*seq(0, 1, 0.05)
## The same metrix, but between x and xx:
mSym(x,xx)
## The asymmetric function with a delta of 0.2:
mAsy <- genDistMetric(0.2)
## The pairwise asymmetric metric between the rows of x:
mAsy(x)
## The same metrix, but between x and xx:
mAsy(x,xx)
Run the code above in your browser using DataLab