
Convert a pedigree data frame into visNetwork-ready diagram data
Source:R/makePedigreeDiagramData.R
makePedigreeDiagramData.RdBuilds the node and edge tables consumed by visNetwork::visNetwork()
from a pedigree data frame: one node per individual, sex-coded to a node
shape, positioned by generation; one directed edge per known sire and one
per known dam, pointing from parent to child.
Arguments
- ped
data frame with
id,sire,dam,sex, andgencolumns (sire/damNAfor unknown parents;genan integer generation number, 0 for founders, as produced byfindGeneration).
Value
A list with two data frames: nodes (id, label,
shape, level, title) and edges (from,
to). title is an HTML hover-tooltip string (issue #135)
giving ID, sex, generation, sire, and dam.
Examples
library(nprcgenekeepr)
diagramData <- makePedigreeDiagramData(nprcgenekeepr::examplePedigree)