checkParentIDs: Validates and Optionally Repairs Parent IDs in a Pedigree...

View source: R/checkParents.R

checkParentIDsR Documentation

Validates and Optionally Repairs Parent IDs in a Pedigree Dataframe

Description

This function takes a pedigree object and performs two main tasks: 1. Checks for the validity of parent IDs, specifically looking for instances where only one parent ID is missing. 2. Optionally repairs the missing parent IDs based on a specified logic.

Usage

checkParentIDs(
  ped,
  verbose = FALSE,
  repair = FALSE,
  repairsex = repair,
  addphantoms = repair,
  parentswithoutrow = repair
)

Arguments

ped

A dataframe representing the pedigree data with columns 'ID', 'dadID', and 'momID'.

verbose

A logical flag indicating whether to print progress and validation messages to the console.

repair

A logical flag indicating whether to attempt repairs on missing parent IDs.

repairsex

A logical flag indicating whether to attempt repairs on sex of the parents

addphantoms

A logical flag indicating whether to add phantom parents for missing parent IDs.

parentswithoutrow

A logical flag indicating whether to add parents without a row in the pedigree.

Value

Depending on the value of 'repair', either a list containing validation results or a repaired dataframe is returned.

Examples

## Not run: 
ped <- data.frame(ID = 1:4, dadID = c(NA, 1, 1, 2), momID = c(NA, NA, 2, 2))
checkParentIDs(ped, verbose = TRUE, repair = FALSE)

## End(Not run)

BGmisc documentation built on June 11, 2025, 1:07 a.m.