Learn R Programming

mmod (version 1.3.2)

dist.codom: Calculate distance between individual for co-dominant locus

Description

This function calculates the distance between individuals in a genind object based on their genotypes. Specifically, the simple metric of Kosman and Leonard (2005) in which distance is calculated as a propotion of shared alleles at each locus.

Usage

dist.codom(x, matrix = TRUE, global = TRUE, na.rm = TRUE)

Arguments

x
genind object (from package adegenet)
matrix
boolean: if TRUE return matrix (dist object if FALSE)
global
boolean: if TRUE, return a single global estimate based on all loci. If FALSE return a list of matrices for each locus. if FALSE
na.rm
boolean: if TRUE remove individuals with NAs

Value

either a list of distance matrices, one for each locus or a single matrix containing the mean distance between individuals across all lociDropped for each distance matrix and object of class "na.action" containing indices to those indivudals in the genind object which where omitted due to having NAs

References

Kosman E., Leonard, K.J. Similarity coefficients for molecular markers in studies of genetic relationships between individuals for haploid diploid, and polyploid species. Molecular Ecology. 14: 415-424

Examples

Run this code
data(nancycats)
dm <- dist.codom(nancycats[40:45], matrix=FALSE)
head(dm)

Run the code above in your browser using DataLab