Commit 18c7602e69fd98ea57dcd9e51e86d07062aeebf1
1 parent
743d3ade8d
Exists in
master
error in NAFIXING fixed
Showing
1 changed file
with
3 additions
and
5 deletions
Show diff stats
RClean2.R
| ... | ... | @@ -88,16 +88,14 @@ cinfo <- function(mat){ |
| 88 | 88 | NAFIXING <- function(GIDNAM){ |
| 89 | 89 | row <- dim(GIDNAM)[1] |
| 90 | 90 | i <- 1 |
| 91 | - x <- 1 | |
| 92 | 91 | for(i in 1:row){ |
| 93 | - if(grepl("^NA\\s*$",GIDNAM[i,2])==TRUE){ | |
| 94 | - GIDNAM[i,2] <- gsub(".*",paste0(NA,x),GIDNAM[i,2]) | |
| 95 | - x <- x + 1 | |
| 92 | + if(grepl("^NA\\s*$",GIDNAM[i,2])==TRUE||is.na(GIDNAM[i,2])==TRUE){ | |
| 93 | + GIDNAM[i,2] <- GIDNAM[i,1] | |
| 96 | 94 | } |
| 97 | 95 | i <- i + 1 |
| 98 | 96 | } |
| 99 | 97 | GIDNAM |
| 100 | -} | |
| 98 | +} | |
| 101 | 99 | |
| 102 | 100 | #4#Function for changing the gene ID to gene name |
| 103 | 101 | cgeneID <- function(GeneName,DATA){ |