
Get the direct relatives of selected animals from a pedigree
Source:R/getPedDirectRelatives.R
getPedDirectRelatives.RdGets the direct relatives (ancestors and descendants) of the selected
animals from the supplied pedigree (ped).
Arguments
- ids
character vector of animal IDs
- ped
pedigree dataframe object that is used as the source of pedigree information.
logical vector when
FALSEthe unrelated parents of offspring do not get a record as an ego; whenTRUEthey get a place holder record as an ego in which the parent (sire,dam) IDs are set toNA.
Value
A data.frame of pedigree records for the selected animals and
their direct relatives (ancestors and descendants) in ped.
See also
Other direct relatives:
getFileDirectRelatives(),
getLkDirectAncestors(),
getLkDirectRelatives()
Examples
library(nprcgenekeepr)
## A pedigree to search and a focal animal whose direct relatives we want
ped <- nprcgenekeepr::lacy1989Ped
getPedDirectRelatives(ids = "E", ped = ped)
#> id sire dam gen population
#> 1 A <NA> <NA> 0 TRUE
#> 2 B <NA> <NA> 0 TRUE
#> 3 C A B 1 TRUE
#> 4 D A B 1 TRUE
#> 5 E <NA> <NA> 0 TRUE
#> 6 F D E 2 TRUE
#> 7 G D E 2 TRUE