有这样一个矩阵Table number 个数
2 1
3 3
1.2 1
7.2 3
1.4 1
3.5 3
2 1
4.2 3
当这个矩阵的Table$number[4]/Table$number[2]-1>1时,让Table$个数[4]<-0,后面相应Table$数字[6],Table$数字[8]的都赋值0,我想问这个循环怎么写
我这样写的
for(i in 1:3){
for(j in 1:2)
{
if(Table$number[2*i+j]/Table$number[j]-1>1)
{
Table$数字[2*i+j]<-0
}
}
}
后面的就不知道怎么写了,就是不知道如何让后面得到0