tri.ineq: Testing for the Triangle Inequality

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Determines if a distance matrix obeys the triangle inequality

Usage

1

Arguments

dist

A distance matrix

Details

Tests if a distance matrix respects the triangle inequality. Often with non-monotonic distance measures and complex data a situation can arise where the triangle inequality (where no single side of a triangle is greater in length than the sum of the other two sides) is not respected.

Value

Returns a TRUE if the inequality is respected, and a FALSE if there is any situation where the triangle inequality is not respected.

Author(s)

Matthew Vavrek

See Also

ecol.dist

Examples

1
2
3
4
5
## sample distance matrix with an impossible triangle
a<-matrix(0.2, 4,4)
a[4,2]<-0.8
a<-as.dist(a)
tri.ineq(a)

Example output

Loading required package: sp
Loading required package: maps
Loading required package: shapefiles
Loading required package: foreign

Attaching package: 'shapefiles'

The following objects are masked from 'package:foreign':

    read.dbf, write.dbf

[1] FALSE

fossil documentation built on March 23, 2020, 5:06 p.m.