ped_subgroups {pedtools} | R Documentation |
Pedigree subgroups
Description
A collection of utility functions for identifying pedigree members with certain properties.
Usage
founders(x, internal = FALSE)
nonfounders(x, internal = FALSE)
leaves(x, internal = FALSE)
males(x, internal = FALSE)
females(x, internal = FALSE)
typedMembers(x, internal = FALSE)
untypedMembers(x, internal = FALSE)
father(x, id, internal = FALSE)
mother(x, id, internal = FALSE)
children(x, id, internal = FALSE)
offspring(x, id, internal = FALSE)
spouses(x, id, internal = FALSE)
unrelated(x, id, internal = FALSE)
parents(x, id, internal = FALSE)
grandparents(x, id, degree = 2, internal = FALSE)
siblings(x, id, half = NA, internal = FALSE)
nephews_nieces(x, id, removal = 1, half = NA, internal = FALSE)
ancestors(x, id, maxGen = Inf, inclusive = FALSE, internal = FALSE)
commonAncestors(x, ids, maxGen = Inf, inclusive = FALSE, internal = FALSE)
descendants(x, id, maxGen = Inf, inclusive = FALSE, internal = FALSE)
commonDescendants(x, ids, maxGen = Inf, inclusive = FALSE, internal = FALSE)
descentPaths(x, ids = founders(x), internal = FALSE)
Arguments
x |
A |
internal |
A logical indicating whether |
id , ids |
A character (or coercible to such) with one or several ID labels. |
degree , removal |
Non-negative integers. |
half |
a logical or NA. If TRUE (resp. FALSE), only half (resp. full) siblings/cousins/nephews/nieces are returned. If NA, both categories are included. |
maxGen |
The number of generations to include. Default: Inf (no limit). |
inclusive |
A logical indicating whether an individual should be counted among his or her own ancestors/descendants |
Value
The functions founders
, nonfounders
, males
, females
, leaves
each return a vector containing the IDs of all pedigree members with the
wanted property. (Recall that a founder is a member without parents in the
pedigree, and that a leaf is a member without children in the pedigree.)
The functions father
, mother
, cousins
, grandparents
,
nephews_nieces
, children
, parents
, siblings
, spouses
,
unrelated
, each returns a vector containing the IDs of all pedigree
members having the specified relationship with id
.
The commands ancestors(x, id)
and descendants(x, id)
return vectors
containing the IDs of all ancestors (resp. descendants) of the individual
id
within the pedigree x
. If inclusive = TRUE
, id
is included in
the output, otherwise not. To cut off at a specific number of generations,
use maxGen
.
For commonAncestors(x, ids)
and commonDescendants(x, ids)
, the output
is a vector containing the IDs of common ancestors (descendants) to all of
ids
.
Finally, descentPaths(x, ids)
returns a list of lists, containing all
pedigree paths descending from each individual in ids
(by default all
founders).
Author(s)
Magnus Dehli Vigeland
Examples
x = ped(id = 2:9,
fid = c(0,0,2,0,4,4,0,2),
mid = c(0,0,3,0,5,5,0,8),
sex = c(1,2,1,2,1,2,2,2))
spouses(x, id = 2) # 3, 8
children(x, 2) # 4, 9
siblings(x, 4) # 9 (full or half)
unrelated(x, 4) # 5, 8
father(x, 4) # 2
mother(x, 4) # 3
siblings(x, 4, half = FALSE) # none
siblings(x, 4, half = TRUE) # 9
ancestors(x, 6) # 2, 3, 4, 5
ancestors(x, 6, maxGen = 2, inclusive = TRUE) # 4, 5, 6
descendants(x, 2) # 4, 6, 7, 9
descendants(x, 2, maxGen = 2, inclusive = TRUE) # 2, 4, 9
leaves(x) # 6, 7, 9
founders(x) # 2, 3, 5, 8