Learn R Programming

nprcgenekeepr (version 3.0.0)

makeCEPH: Make a CEPH-style pedigree for each id

Description

Part of Relations

Usage

makeCEPH(id, sire, dam)

Value

List of lists: fields: id, subfields: parents, pgp, mgp. Pedigree information converted into a CEPH-style list. The top level list elements are the IDs from id. Below each ID is a list of three elements: parents (sire, dam), paternal grandparents (pgp: sire, dam), and maternal grandparents (mgp: sire, dam).

Arguments

id

character vector of the unique identifiers of all individuals; a duplicated id stops the function with a duplicate row.names error.

sire

character vector, parallel to id, with the identifier of each individual's father (NA if unknown).

dam

character vector, parallel to id, with the identifier of each individual's mother (NA if unknown).

Details

Creates a CEPH-style pedigree for each id, consisting of three generations: the id, the parents, and the grandparents. Inserts NA for unknown pedigree members. Ids given as numbers or as a factor are taken as their text.

Examples

Run this code
library(nprcgenekeepr)
ped <- nprcgenekeepr::lacy1989Ped
pedCEPH <- makeCEPH(ped$id, ped$sire, ped$dam)
head(ped)
head(pedCEPH$F)

Run the code above in your browser using DataLab