powered by
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).
pedtools
connectedComponents(id, fid = NULL, mid = NULL, fidx = NULL, midx = NULL)
A vector of ID labels (character or numeric).
The ID labels of the fathers (or "0" if missing).
The ID labels of the mothers (or "0" if missing).
(For internal use mostly.) Integer vectors with paternal (resp. maternal) indices. These may be given instead of id, fid, mid.
id
fid
mid
A list, where each element is a subset of id constituting a connected pedigree.
# NOT RUN { # 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) # }
Run the code above in your browser using DataLab