Combines two vectors by randomly selecting one allele or the other at each position. Alleles may be of any class that does not require attributes as the vectors are combined with c().

chooseAllelesChar(a1, a2)

Arguments

a1

vector with first parent alleles for each individual

a2

vector with second parent alleles for each individual a1 and a2 are equal length vectors of alleles for one individual

Value

An integer vector with the result of sampling from a1 and a2 according to Mendelian inheritance.

Details

The current implementation is slower than the one using integer vectors (chooseAlleles).