hypo_hwe computes Hardy-Weinberg genopye frequencies for p ranging from 0 to 1.

hypo_hwe(n = 100L)

Arguments

n

integer scalar (>= 2, mandatory), length of the allele frequency range

Details

This function creates a range of allele frequencies ranging from p = 0 to p = 1 and computes the respective genotype frequencies according to Hardy-Weinberg:

  • \(q = 1 - p\)

  • \(AA = p^2\)

  • \(Aa = 2pq\)

  • \(aa = q^2\)

The function returns the results as table.

Examples

genotype_hwe <- hypo_hwe(100)