I have factor level problem. I thought it would be solved with stringAsFactors=FALSE, but it's not working.
here pL is a list with 290 elements.
I would like to define an empty data.frame, than fill it using rbind.
ttable <- data.frame(ID_REF=c(1,2,3,4,5,6), IDENTIFIER=c("ERN2", "HTR5A", "ACPP", "GNAO1", "HTR1F", "DNAH1"), GSM11708=c("<NA>", 1.994, "<NA>","<NA>","<NA>","<NA>"), GSM11735=c(0.18, "<NA>","<NA>","<NA>","<NA>","<NA>"))
pL <- list("GSTT4", "AHRR", "HAX1", "DNM1L", "MEIS1", "SLC17A3", "CES2", "MLL2", "IKBKB", "GSTA4")
gn <- data.frame(gn = character(0), stringsAsFactors=FALSE)
for(i in pL){
  n <- nrow(subset(ttable, IDENTIFIER==i))
  if (n < 1){
    gn <- rbind(gn, i)
  }
  else{
    for(j in 1:n){
      gn <- rbind(gn, i)
    }
  }
}
 
     
    