Learn R Programming

pedtools (version 1.1.0)

randomPed: Random pedigree

Description

Generate a random pedigree by applying random mating starting from a finite population. The resulting pedigree will have f + g members, where f is the number of founders and g is the number of matings.

Usage

randomPed(g, founders = rpois(1, 3) + 1, selfing = FALSE, seed = NULL)

Arguments

g

A positive integer: The number of matings.

founders

A positive integer: The size of the initial population.

selfing

A logical indicating if selfing is allowed.

seed

A numerical seed for random number generation. (Optional.)

Value

A ped object.

Details

The sampling scheme for choosing parents in each mating depends on the selfing parameter. If selfing = FALSE, a father is randomly sampled from the existing males, and a mother from the existing females. If selfing = TRUE then one parent P1 is sampled first (among all members), and then a second parent from the set consisting of P1 and all members of the opposite sex. The gender of the child is randomly chosen with equal probabilities.

Examples

Run this code
# NOT RUN {
randomPed(3, 3)
randomPed(3, 3, selfing = TRUE)

# }

Run the code above in your browser using DataLab