mate: Produces offspring

View source: R/mate.R

mateR Documentation

Produces offspring

Description

This function is mostly for simulation work and functions to produce a set of offspring for the individuals passed.

Usage

mate(mom, dad = NULL, N = 1)

Arguments

mom

This is the 'maternal' individual in that all the metadata in the data.frame that describes this individual will be transfered to the offspring.

dad

This is the 'paternal' individual and will contribute only half of its genetic compliment to the offspring.

N

The number of offspring to produce.

Value

A data.frame of offspring.

Note

There are several 'hidden' things in this routine. First, if you do not pass a 'dad' object, it will assume you want a selfed offspring. Second, it will by default only make a single offspring. Next, if you have a column labeled "Sex" it will make a random selection of which sex each offspring should be and only mate the opposite sexes based upon the levels of the values in the Sex column. Finally, if there are columns ID and OffID in the mom, then all offspring will have the same ID as the mom but will have OffID equal to 1:N to conform with how the functions like paternity() operate. If you do not have ID and OffID then it will do nothing special. This can be more than one individual mom & dad, but if you pass several, they will all have the same number of offspring (if you only specify a single value of N) or different numbers of offspring (if N is passed as a vector and is of length equal to that of mom and dad)

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

f <- data.frame(Allele=LETTERS[1:2], Frequency=c(0.5,0.5))
adults <- data.frame( ID=1:2, Locus=make_loci(f,N=2) )
adults
mate( adults[1,], adults[2,], N=10)

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.