Description Usage Arguments Examples
Does the distance matric come from a metric
1 2 3 | is_distance_matrix(mat, tolerance = .Machine$double.eps^0.5)
triangle_inequality(mat, tolerance = .Machine$double.eps^0.5)
|
mat |
The matrix to evaluate |
tolerance |
Differences smaller than tolerance are not reported. |
1 2 3 4 5 6 7 | data <- matrix(rnorm(20), ncol = 2)
dm <- pdist(data)
is_distance_matrix(dm)
triangle_inequality(dm)
dm[1, 2] <- 1.1 * dm[1, 2]
is_distance_matrix(dm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.