Error .. missing value where TRUE/FALSE needed

后端 未结 3 584
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 19:34

I have been trying to run this code (below here) and I have gotten that message \"Error in if (temp[ii] == 0) { : missing value where TRUE/FALSE needed\"...

temp         


        
3条回答
  •  不知归路
    2021-01-28 20:28

    At a guess I'm going to say that this is in R - if so I'm guessing that this line:

    if (temp[i] == 0) (or temp[ii] == 0)
    

    is resulting in an NA, and if conditions must have a TRUE or FALSE value.

    Using a debugger if you can, I'd interrogate the value of temp[i] before the if block.

提交回复
热议问题