从kinship2血统图中删除标签

问题描述 投票:1回答:1

我正在使用亲属关系2绘制野生种群的谱系,并尝试删除个体的标签。我在par()和plot()中尝试了各种参数,但它们要么没有删除标签,要么导致错误。有任何想法吗?

ped <- pedigree(id,dadid,momid,sex)
plot.pedigree(ped)
r bioinformatics
1个回答
0
投票

我们可以在绘图时将空白""(或NA)分配给ids:

#Example pedigrees object the manuals
library(kinship2)
data(sample.ped)
pedAll <- pedigree(sample.ped$id, sample.ped$father, sample.ped$mother, 
                   sample.ped$sex,  #affected=sample.ped$affected,
                   affected=cbind(sample.ped$affected, sample.ped$avail), 
                   famid=sample.ped$ped)
ped2 <- pedAll['2']

#assign "" to id argument.
plot.pedigree(ped2, id = rep("", length(ped2$id)))

#or NA
#plot.pedigree(ped2, id = rep(NA, length(ped2$id)))

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.