I need to set a function that help me in restore the Yes/No variable in 0/1 one.
A function should be
x<-function(DataFrame,VariableName,Yes,No){
.....
}
I set up this code but run only out the function because R do not read the variable setted in () after the dollar sign.
dummy<-function(DB,varr){
BD$varr <- as.character(DB$varr)
DB[BD$varr=="Yes"]<-"1"
DB[BD$varr=="No"]<-"0"
}