is_distance_matrix_ok: Check if matrix fulfills distance matrix conditions

View source: R/checkDM.R

is_distance_matrix_okR Documentation

Check if matrix fulfills distance matrix conditions

Description

The 'is_distance_matrix_ok()' function is used to validate matrix.

Usage

is_distance_matrix_ok(m)

Arguments

m

Distance Matrix which is to be validate

Details

There are distance matrix conditions which should be fulfilled:

3 distance rules

  1. d(x,y) = 0 <=> x = y

  2. d(x,y) = d(y,x)

  3. d(x,y) <= d(x,z) + d(y,z)

Additionally matrix should have the same number of rows and columns, and negative or NA values should not be included.

Value

If all conditions are fulfilled TRUE is returned, else FALSE.


maszdev/dist2location documentation built on June 11, 2025, 11:55 a.m.