mardi 28 avril 2015

Error in if (ncol(x) > nrow(x)) x <- t(x) : argument is of length zero

when I run the code as followed:

n<-length(input)
res<-matrix(rep(0,n*n),nrow=n)
    for(i in 1:length(input)){
      for(j in 1:length(input)){
        if(i!=j){
          res[i,j]<-transfer_entropy_rev(input[[i]],input[[j]],1,1,2)
        }
        else{
          res[i,j]<-0
        }
      }
    }

It showed

 Error in if (ncol(x) > nrow(x)) x <- t(x) : argument is of length zero

Is there any wrong in the if(i!=j), PS:transfer_entropy_rev is the funcion I edit

Aucun commentaire:

Enregistrer un commentaire