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){ ...@@ -85,11 +85,15 @@ is_number <- function(x){
replaceNoYesValues <- function(x){ replaceNoYesValues <- function(x){
#Replace the value with Yes or No #Replace the value with Yes or No
if(is.na(x)) if(is.na(x)){
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" x <- "No"
else if (x==1 | x == "Yes" | x == " Yes" | x=="SI") else if (x=="1" | x == "YES" | x=="SI")
x <- "Yes" x <- "Yes"
else else
x <- "" x <- ""
...@@ -131,14 +135,15 @@ personalizedFun <- function(x, colname){ ...@@ -131,14 +135,15 @@ personalizedFun <- function(x, colname){
} }
if(colname == "SMXFEA"){ if(colname == "SMXFEA"){
if(is.na(x)) x <- replaceNoYesValues(x)
x <- "" #if(is.na(x))
else if(x == 1) # x <- ""
x <- "Yes" #else if(x == 1)
else if (x == 0) # x <- "Yes"
x <- "No" #else if (x == 0)
else if (x == ".") # x <- "No"
x <- "" #else if (x == ".")
# x <- ""
} }
if(colname == "DMRRETH1"){ 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