primary_ancestor_pairs: Return a list of the indices of the primary shared ancestors

View source: R/RcppExports.R

primary_ancestor_pairsR Documentation

Return a list of the indices of the primary shared ancestors

Description

This operates on an ancestry match matrix and uses a simple, divide-by_two relationship between an ancestor and its descendants in the ordering of an ancestry vector to determine which of the matching ancestors are secondary, and then return the ones that are primary.

Usage

primary_ancestor_pairs(M)

Arguments

M

an ancestry match matrix (it is a logical matrix)

Value

A list of pairs. Each pair is the 1-based index of ancestor of ind_1, then ind_2 of the primary shared ancestors.

Examples

# find primary ancestor pairs of example AMMs
lapply(example_amms, primary_ancestor_pairs)

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