View source: R/ped_connected.R
connectedComponents | R Documentation |
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).
connectedComponents(id, fid = NULL, mid = NULL, fidx = NULL, midx = NULL)
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 |
A list, where each element is a subset of id
constituting a
connected pedigree.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.