This function identifies records in an entire branch of the family tree above a certain individual.

get_ancestors(
  gedcom,
  indi_xref = character(),
  inc_indi = FALSE,
  inc_sibs = FALSE,
  inc_famg = FALSE,
  inc_supp = FALSE,
  birth_only = TRUE
)

Arguments

gedcom

A tidyged object.

indi_xref

The xref of an Individual record to act on if one is not activated (will override active record).

inc_indi

Whether to also include the individual themselves.

inc_sibs

Whether to also include all siblings of ancestors (siblings of this individual will only be included if the individual is included).

inc_famg

Whether to also include all Family Group records where this individual is a child (and all ancestors' Family Group records).

inc_supp

Whether to also include all supporting records (Note, Source, Repository, Multimedia).

birth_only

Whether to only include biological ancestors.

Value

A vector of xrefs of ancestors.

Examples

get_ancestors(sample555, "@I3@")
#> [1] "@I1@" "@I2@"
get_ancestors(sample555, "@I3@", inc_indi = TRUE)
#> [1] "@I3@" "@I1@" "@I2@"
get_ancestors(sample555, "@I3@", inc_indi = TRUE, inc_famg = TRUE)
#> [1] "@F1@" "@I3@" "@I1@" "@I2@"