search_up: Depth first search up the pedigree to N generations.

search_upR Documentation

Depth first search up the pedigree to N generations.

Description

Call this with c = 0 for the original individual, and it will go back, n generations. Unlike in R, this is 0-based. So, n = 1 is parents, n = 2 is grandparents and so on.

Arguments

i

the index of the node to call this on

c

the current generation level. 0 = the first (i.e. the sampled individual)

n

the number of generations back to go. 1 means go no further than the parents. 2 means go no further than the grandparents.

P

the pedigree structure

C

a reference to a character vector to which sampled individuals' IDs will get pushed on. At the end, we can unique them.


eriqande/CKMRpop documentation built on Jan. 25, 2024, 2:10 p.m.