错误:绘制图形时使用Na / NaN参数

时间:2018-10-13 20:29:31

标签: r

当我尝试绘制图形时,有时似乎会出现这种情况。

Error in (Midpoint.NO.TEL1.1[k, 2] - 250):(Midpoint.NO.TEL1.1[k, 2] +  : NA/NaN argument

程序有时有可能使用完全相同的代码来绘制图形,而有时却不能?我该怎么解决?

attach(ChromoSizes)
NO.TEL1.X1<-c(1:ChrSizes[1])
NO.TEL1.Y1<-rep(0,ChrSizes[1])
attach(FullMap.TEL1)
results <- matrix(0, nrow=1182, ncol=501)
 for (k in 1:1182) {
results[k,1:501] <- NO.TEL1.Y1[(Midpoint.NO.TEL1.1[k,2]-250) : (Midpoint.NO.TEL1.1[k,2]+250)]
 }
 pileup <- colMeans(results)
plot(pileup, type = "l",col="dark blue",lwd=2,xlab ="Distance relative to DSB (bp)",ylab = "Nucleosome Occupacy")

0 个答案:

没有答案