Compute a measure of genetic diversity at each locus
divlocus(dat)
Arguments
dat: A binary matrix, rows are haplotypes and columns are binary markers
Details
This function implements a measure of diversity for a locus j
as in Clayton (2002). If zij represents the allele j of haplotype i, for i=1,...,N and assuming that alleles are coded as 0 and 1, the diversity measure can be written as
Dj=2∗N(i=1∑Nzij2−(i=1∑Nzij)2)
Returns
A vector containing the diversity measure for all markers