Skip to contents

Appends a new column to ped containing the generational distance between each individual and the focal person. Unrelated individuals receive NA.

Usage

ped2genDistFocal(
  ped,
  focal_id,
  method = c("rank", "path", "mrca_min", "mrca_max", "mrca_all"),
  col_name = NULL,
  personID = "ID",
  momID = "momID",
  dadID = "dadID",
  max_gen = 25L,
  ...
)

Arguments

ped

A pedigree data frame.

focal_id

ID of the target individual.

method

Distance method; see getGenDist.

col_name

Name of the new column. Defaults to paste0("genDist_", method, "_", focal_id).

personID

Character. ID column name. Default "ID".

momID

Character. Mother ID column name. Default "momID".

dadID

Character. Father ID column name. Default "dadID".

max_gen

Integer. Maximum generations to traverse. Default 25.

...

Additional arguments passed to ped2com (e.g. adjacency_method, verbose, sparse).

Value

The input ped with one additional column.