The function calculates Tajima's D.

TajimaD(SFS)

Arguments

SFS

vector with the site frequency spectrum.

Value

Tajima's D.

Details

See SFS for explanation of the site frequency spectrum.

If one runs TajimaD with a vector that contains anything other than natural numbers, an error will occur.

For details about Tajima's D, consult the analyzeDNA vignette.

References

Wakeley J. (2009) Coalescent Theory: An Introduction. Colorado: Roberts and Company Publishers.

Examples

TajimaD(c(3,0,2,1,0,0,0))
#> [1] 0.1587498