Commit 6d57f049 authored by pxp9's avatar pxp9

pequeña mejora en la sustitucion de Yes/No

parent 3570d2a0
......@@ -85,11 +85,15 @@ is_number <- function(x){
replaceNoYesValues <- function(x){
#Replace the value with Yes or No
if(is.na(x))
if(is.na(x)){
x <- ""
else if (x==0 | x =="No" | x ==" No" | x =="NO")
return (x)
}
x <- trimws(toupper(x))
if (x=="0" | x =="NO")
x <- "No"
else if (x==1 | x == "Yes" | x == " Yes" | x=="SI")
else if (x=="1" | x == "YES" | x=="SI")
x <- "Yes"
else
x <- ""
......@@ -131,14 +135,15 @@ personalizedFun <- function(x, colname){
}
if(colname == "SMXFEA"){
if(is.na(x))
x <- ""
else if(x == 1)
x <- "Yes"
else if (x == 0)
x <- "No"
else if (x == ".")
x <- ""
x <- replaceNoYesValues(x)
#if(is.na(x))
# x <- ""
#else if(x == 1)
# x <- "Yes"
#else if (x == 0)
# x <- "No"
#else if (x == ".")
# x <- ""
}
if(colname == "DMRRETH1"){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment