search_down: Depth first search down the pedigree to N generations.

search_downR Documentation

Depth first search down the pedigree to N generations.

Description

When you call this from within search_up(), c should be set at 0, and the algorithm will run down for, n generations from there. Unlike in R, this is 0-based. So, n = 0 is self, n = 1 is kids, n = 2 is grandkids, and so forth.

Arguments

i

the index of the node to call this on

c

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

n

the number of generations back to down. 1 means go no further than the offspring. 2 means go no further than the grandkids.

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.