有谁知道如何解决这个问题?
for (x in 1:nrow(homer1)-1) {if ((homer1$Start [x+1] +1) == homer1$End [x]) {homer1$annnot_prom <- paste(homer1$Detailed.Annotation, homer1$Nearest.PromoterID, sep="_") } else {homer1$annnot_prom <- homer1$Detailed.Annotation} }
Error in if ((homer1$Start[x + 1] + 1) == homer1$End[x]) { :
argument is of length zero
答案 0 :(得分:1)
在for
循环中添加一些括号:
for (x in 1:(nrow(homer1)-1))