GetRelCat {sequoia} | R Documentation |
Determine the relationship between individual X and all other individuals in the pedigree, going up to 1 or 2 generations back.
GetRelCat(x, Ped, GenBack = 2)
x |
The focal individual, either its rownumber in the pedigreee or ID. |
Ped |
dataframe with pedigree; columns id - dam - sire. |
GenBack |
Number of generations back to consider; 1 returns parent-offspring and sibling relationships, 2 also returns grandparental, avuncular and first cousins. |
if
A named vector of length equal to the number of rows in Ped, with for each ID its relationship to the focal individual:
S |
Self |
M |
Mother |
P |
Father |
O |
Offspring |
FS |
Full sibling |
MHS |
Maternal half-sibling |
PHS |
Paternal half-sibling |
MGM |
Maternal grandmother |
MGF |
Maternal grandfather |
PGM |
Paternal grandmother |
PGF |
Paternal grandfather |
GO |
Grand-offspring |
FA |
Full avuncular; maternal or paternal aunt or uncle |
HA |
Half avuncular |
FN |
Full nephew/niece |
HN |
Half nephew/niece |
FC1 |
Full first cousin |
DFC1 |
Double full first cousin |
U |
Unrelated (or otherwise related) |
## Not run: # make NxN matrix with relationship categories: RCM <- sapply(1:nrow(Ped), GetRelCat, Ped) # table is considerably faster on a factor than a character vector: table(factor(RCM, levels=c("M","P","FS","MHS","PHS","MGM"))) # note that sibling & cousin pairs are counted twice! ## End(Not run)