connectedComponents {pedtools}R Documentation

Connected pedigree components

Description

Compute the connected parts of a pedigree. This is an important step when converting pedigree data from other formats (where disconnected pedigrees may be allowed) to pedtools (which requires pedigrees to be connected).

Usage

connectedComponents(id, fid = NULL, mid = NULL, fidx = NULL, midx = NULL)

Arguments

id

A vector of ID labels (character or numeric).

fid

The ID labels of the fathers (or "0" if missing).

mid

The ID labels of the mothers (or "0" if missing).

fidx, midx

(For internal use mostly.) Integer vectors with paternal (resp. maternal) indices. These may be given instead of id, fid, mid.

Value

A list, where each element is a subset of id constituting a connected pedigree.

Examples


# A trio (1-3) and a singleton (4)
x = data.frame(id = 1:4, fid = c(2,0,0,0), mid = c(3,0,0,0))
connectedComponents(x$id, x$fid, x$mid)


[Package pedtools version 2.6.0 Index]