【发布时间】:2018-11-15 21:45:48
【问题描述】:
我正在尝试使用 pegas 生成单倍型网络。我设法完成了基本网络,但是当我尝试为每个“馅饼”添加不同颜色的切片时,我似乎无法继续前进。
我将使用木鼠数据集复制我的错误:
data(woodmouse)
x <- woodmouse[sample(15, size = 110, replace = TRUE), ]
h <- haplotype(x)
net <- haploNet(h)
plot(net, size=attr(net, "freq"), scale.ratio = 2, cex = 0.8)
ind.hap<-with(
stack(setNames(attr(h, "index"), rownames(h))),
table(hap=ind, pop=rownames(x)[values])
)
使用上面的代码,我设法绘制网络没有问题,但是当我尝试执行最后四行代码时,出现以下错误:
ind.hap<-with(
stack(setNames(attr(h, "index"), rownames(h))),
table(hap=ind, pop=rownames(x)[values])
)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘raster’ for signature ‘"integer"’
关于可能是什么问题的任何建议?
【问题讨论】:
-
成功了,谢谢 MrFlick。我猜想与其他包有冲突,可能是光栅。干杯
标签: r dna-sequence phylogeny genetics