do_dist: Compute distance matrix from a data frame

View source: R/do_dist.R

do_distR Documentation

Compute distance matrix from a data frame

Description

Compute distances between rows in a data frame. Elements are taken to be factors so the only meaningful result of comparing two rows (i.e. witnesses) for the same column (i.e. variation site) is whether their elements match. Simple matching is used to compute the distance between two rows. The simple matching distance between two rows is the number of columns that differ divided by number of columns compared. (Columns where either row has NA are not compared.)

Usage

do_dist(fr, digits = 3)

Arguments

fr

A data frame.

digits

Number of digits for rounding distances (default = 3).

Value

A square matrix giving the simple matching distance between every combination of two rows.


tjfinney/ANTTV documentation built on July 1, 2024, 11 p.m.