mercredi 18 décembre 2019

Ifelse returning NAs instead of the false value

I'm running a bit of code like this:

DATA$a<-ifelse((DATA$b=="Yes"|DATA$c=="Yes"),"Yes","No") 

Expecting to get a data column with both Yes and No values outputted, but instead I only get Yes values and NAs where No values should be. There definitely should be No values but they don't seem to appear at all.

Any ideas?

Thanks!

Aucun commentaire:

Enregistrer un commentaire