Learn R Programming

nprcgenekeepr (version 2.0.0)

getFounders: Get the founder ids from a pedigree

Description

Part of Pedigree Curation

Usage

getFounders(ped)

Value

A vector of the id values of the founders, in pedigree order. It has the same type as ped$id and is empty when there are no founders.

Arguments

ped

datatable that is the Pedigree. It contains pedigree information. The fields id, sire and dam are required.

Details

A founder is an animal whose sire and dam are both unknown (NA). Animals with exactly one known parent (partial parentage) are not founders.

See Also

isFounder for the founder logical mask.

Examples

Run this code
library(nprcgenekeepr)
ped <- data.frame(
  id = c("A", "B", "C", "D", "E", "F", "G"),
  sire = c(NA, NA, "A", "A", NA, "D", "D"),
  dam = c(NA, NA, "B", "B", NA, "E", "E"),
  stringsAsFactors = FALSE
)
getFounders(ped)

Run the code above in your browser using DataLab