Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating dendrograms from genealogy data in R

Is there any way to generate a dendrogram where each level of the graph represents a generation and only sons of the same father are connected at each level?

I'm attempting to use R's hclust and plot functions to generate a dendrogram of father-son lineage. The desired result is a dendrogram where each generation of sons is placed on the same line, under their father.

I was hoping that hclust and the "complete" method would allow me to use the dissimilarity matrix to assign sons of the same father a 0 dissimilarity score and then be placed on the same hierarchical level, exclusive from any other entities in the dataset. This doesn't work, there are sons of different generations on the same level.

Any help is greatly appreciated!

Here is some example data:

father,son
A,C
A,D
A,E
B,F
B,G
C,H
C,I
F,J
F,K
G,L

Agent A has three sons: C, D, and E; and two grandsons through C: H and I.

Agent B has two sons: F and G; and a total of three grandsons: J, K, and L.

like image 725
mattrepl Avatar asked Oct 25 '22 20:10

mattrepl


1 Answers

Do you need something like this?

"Drawing pedigree diagrams with R and graphviz" by Jing Hua Zhao

If you search for the name of the paper by author it is available from many sources.

like image 150
yuk Avatar answered Nov 22 '22 09:11

yuk