Learn R Programming

optiSel (version 2.0.9)

sampleIndiv: Sample Individuals from Pedigree

Description

Sampling Individuals from a Pedigree.

Usage

sampleIndiv(Pedig, from="Born", each=100)

Value

Character vector containing the IDs of the individuals.

Arguments

Pedig

Pedigree with column Indiv and the column specified in parameter from.

from

Column name. From each cohort specified in this column (e.g. year of birth), the number of individuals specified in parameter each is sampled. If a cohort contains less individuals, then all individuals are chosen.

each

Number of individuals to be sampled from each cohort.

Author

Robin Wellmann

Details

From each cohort, a specified number of individuals will be sampled. If a cohort contains less individuals, then all individuals are sampled. This may be needed for estimating population specific parameters from a subset of a large pedigree to reduce computation time.

Examples

Run this code
data("PedigWithErrors")
set.seed(1)
Pedig <- prePed(PedigWithErrors)
use   <- Pedig$Breed=="Hinterwaelder"
keep  <- sampleIndiv(Pedig[use, ], from="Born", each=5)
keep

Run the code above in your browser using DataLab