Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

HWprob

Hardy-Weinberg probabilities


Description

Hardy-Weinberg probabilities

Usage

HWprob(allele1, allele2, afreq, f = 0)

Arguments

allele1, allele2

Vectors of equal length, containing alleles in the form of indices of afreq

afreq

A numeric vector with allele frequencies

f

A single number in [0, 1]; the inbreeding coefficient

Value

A numeric vector of the same length as allele1 and allele2

Examples

p = 0.1; q = 1-p
hw = HWprob(c(1,1,2), c(1,2,2), c(p, q))
stopifnot(all.equal(hw, c(p^2, 2*p*q, q^2)))

pedprobr

Probability Computations on Pedigrees

v0.5.0
GPL-3
Authors
Magnus Dehli Vigeland [aut, cre] (<https://orcid.org/0000-0002-9134-4962>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.