for loop is not looping and turning empty int

25 Views Asked by At

I am using this for loop:

file.1 <- c()
for ( i in 1:length(gene)) {
  ID=gene[i]
  file.1 <- c(which(colnames(tsr)==ID),file.1)
  
}

It is showing me empty integer ~. The code is reflecting on two different files in my environment tsr which is the large sample and file.1 which has chr [1:3]. When I run the code, there should be value in "i" and value in "ID" but none are running. I am afraid that I am missing a package as it used to run smoothly. I would appreciate all the help I can get~

0

There are 0 best solutions below