Learn R Programming

nprcgenekeepr (version 1.0.5)

chooseAllelesChar: Combines two vectors of alleles when alleles are character vectors.

Description

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().

Usage

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).