软件包kinship2中的谱系重排图

时间:2018-07-19 01:08:36

标签: r plot

我正在尝试使用软件包ped绘制一个小的血统书kinship2(下面是完整结构)。当前的绘图行为是复制一个节点,以突破子谱系(用虚线显示)。

我想修改谱系或绘图参数,以防止示例中的节点ID10分裂。我尝试过修改谱系中ID的顺序并在plot调用中更改width参数,但无法找到产生所需输出的组合。

library(kinship2)

head(as.data.frame(ped))
#     id dadid momid    sex
#  1 ID1   ID6  ID15 female
#  2 ID2  ID11  ID10 female
#  3 ID3     0     0   male
#  4 ID4   ID5   ID3 female
#  5 ID5     0     0 female
#  6 ID6   ID8  ID10 female

plot(ped, col=c(rep(1,9),2,rep(1,5))) #color the misbehaving node red

undesired pedigree 数据:

dput(ped)
structure(list(id = c("ID1", "ID2", "ID3", "ID4", "ID5", "ID6", 
"ID7", "ID8", "ID9", "ID10", "ID11", "ID12", "ID13", "ID14", 
"ID15"), findex = c(6, 11, 0, 5, 0, 8, 0, 0, 0, 0, 13, 11, 0, 
13, 0), mindex = c(15, 10, 0, 3, 0, 10, 0, 0, 0, 0, 3, 9, 0, 
7, 0), sex = structure(c(1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 
2L, 1L, 1L, 1L, 1L, 2L), .Label = c("female", "male"), class = "factor")), class = "pedigree") 

0 个答案:

没有答案