|
The function
distance
evaluates the distance between two
-dimensional vectors with respect to a specified metric. The
possible metrics are given in the following table:
Distance | XploRe Name |
![]() |
"l1" |
![]() |
"l2", "euclid" |
Maximum | "maximum" |
Cosine | "cosine" |
![]() |
"chisquare" |
Centroid | "centroid" |
Tanimoto | "tanimoto" |
Matching | "matching" |
The first argument of
distance
is the matrix,
the second argument the
XploRe
name.
By default the second argument is
"l2". The commands
x = #(1, 4)~#(1, 5) distance(x,"l1")define the matrix x and evaluate the
Contents of distance [1,] 0.000000 7.000000 [2,] 7.000000 0.000000while the command
distance(x)yields the
Contents of distance [1,] 0.000000 5.000000 [2,] 5.000000 0.000000The examples for this section are collected in