-2
我想多给点信息。我开始与4个基因并确定其开启和关闭的条件下,使用下面的脚本:错误:找不到对象'len'
Proli <- function (DISC1, GSK3B, DIXDC1, CTNNB1){
inputs <- permutations(2,4,v=c(0,1),repeats.allowed=TRUE);
if (DISC1 == 1 && GSK3B == 0 && DIXDC1 == 1 && CTNNB1 == 1){
Proliferation <- "TRUE"
}
else
{
Proliferation <- "FALSE"
}
Proliferation
}
然后我装gtools
和heirpart
。
inputs <- permutations(2,26,v=c(0,1),repeats.allowed=TRUE)
len <- length[inputs]
for(i in 1:len)
{
if(inputs[i,1] == 1 && inputs[i,2] == 0 && inputs[i,3] == 1 && inputs[i,4] == 1){
#Constructing a Truth Table
output[i] <- 1
}
else{
output[i] <- 0
}
}
现在,我得到错误的输出[I] < - 0:对象 '输出' 未找到
你必须定义'len' b在for循环之前。你的脚本从哪里来? – 2016-03-01 06:47:34
也许你的意思是:(for I(in 1:nrow(inputs))'? –
你在哪里初始化脚本中的对象'len'? – user1021713