[英]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. 我试图使用R的hclust和绘图函数来生成父子谱系的树状图。 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. 我希望hclust和“完整”方法允许我使用相异矩阵为同一个父亲的儿子分配0相异度分数,然后放在同一层级上,不包括数据集中的任何其他实体。 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,C
A,D 广告
A,E A,E
B,F B,F
B,G B,G
C,H C,H
C,I C,I
F,J 缩略词
F,K F,K
G,L G,L
Agent A has three sons: C, D, and E; 代理A有三个儿子:C,D和E; and two grandsons through C: H and I.
和两个孙子通过C:H和I.
Agent B has two sons: F and G; 特工B有两个儿子:F和G; and a total of three grandsons: J, K, and L.
共有三个孙子:J,K和L.
Do you need something like this? 你需要这样的东西吗?
"Drawing pedigree diagrams with R and graphviz" by Jing Hua Zhao “用R和graphviz绘制血统图”,由Jing Hua Zhao 撰写
If you search for the name of the paper by author it is available from many sources. 如果您按作者搜索论文的名称,可以从许多来源获得。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.