View source: R/Labelling_and_plotting_functions.R
| get_generations | R Documentation |
Calculates generational distances and kinship coefficients between all pairs of individuals represented in a directed family graph. The function identifies shortest paths between individuals, accounts for common ancestors, and derives kinship coefficients based on the number of generations separating each pair.
get_generations(fam_graph)
fam_graph |
An igraph object representing the family structure, where directed edges indicate parent–child relationships (from parent to child). See get_family_graphs(). |
A tibble with one row per unique pair of individuals and the following columns:
Identifier for the first individual.
Identifier for the second individual.
Estimated kinship coefficient between id1 and id2.
Mean number of generations separating id1 from the common ancestor.
Mean number of generations separating id2 from the common ancestor.
The family graph is centered on a proband (typically the same id as fid), all relations for the proband can be found by selecting only relations with the proband's id in the column id1.
# see vignette on identifying and labelling relatives
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.