Skip to contents

Builds 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.

Usage

makePedigreeDiagramData(ped)

Arguments

ped

data frame with id, sire, dam, sex, and gen columns (sire/dam NA for unknown parents; gen an integer generation number, 0 for founders, as produced by findGeneration).

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)