offspring: Descendants of an individual per generation

View source: R/offspring.R

offspringR Documentation

Descendants of an individual per generation

Description

Counts and collects progeny and phenotyped progeny of an individual in successive generations. In pedigrees with generation overlap, animals are reported in the 1st generation that they appear in, rather than in multiple generations.

Usage

offspring(ped, id, pheno)

Arguments

ped

: data.frame with columns corresponding to ID, SIRE, DAM. Missing value is 0.

id

: The ID of the individual, for which the descendants to be extracted.

pheno

: Vector of phenotyped individuals.

Value

prgn : list of progeny per generation.

prgn.ph : list of phenotyped progeny per generation.

Examples

ped = data.frame(V1 = 1:19,
   V2 = c(0,0,1,1,0,0,0,0,0,4,5,5,7,0,0,9,0,0,12),
   V3 = c(0,0,0,2,0,2,0,3,3,3,0,6,8,8,8,10,11,11,0))
pheno = 10:18
# Find progeny and phenotyped progeny of individual 1.
offspring(ped, 1, pheno)
# Find phenotyped progeny of individual 1, in the 2nd generation.
offspring(ped, 1, 10:18)$prgn.ph[[2]]
# If only interested in finding the progeny of individual 1:
offspring(ped, 1, c())$prgn


ggroups documentation built on March 28, 2022, 1:06 a.m.