Learn R Programming

DEMEtics (version 0.8.1)

Hj: Heterozygosity Level Within a Single Population

Description

From a set of allelefrequencies (from a single locus), the homozygosity is calculated by taking the sum of the squared allelefrequencies of all alleles. The heterozygosity is calculated by subtracting the homozygosity from 1 (Jost 2008, p. 4022).

Usage

Hj(p)

Arguments

p
a vector that contains the frequencies of all alleles for a single locus

Value

  • The value returned, 'Hj', is the heterozygosity level for a single locus in a single population.

Details

The equation for the calculation of the heterozygosity is taken from Jost (2008, p. 4022).

References

Jost, L. 2008 Gst and its relatives do not measure differentiation. Molecular Ecology 17, 18, p. 4015--4026

See Also

all.pops.D, all.pops.Dest, all.pops.Dest.Chao, all.pops.Gst, all.pops.Gst.est, pair.pops.D, pair.pops.Dest, pair.pops.Dest.Chao, pair.pops.Gst, pair.pops.Gst.est

Examples

Run this code
allele.numbers <- c(34,56,2,78,22,12,98)
all.alleles <- sum(allele.numbers)
allele.frequencies <- allele.numbers/all.alleles

Hj(allele.frequencies)

Hj

Run the code above in your browser using DataLab