samedi 4 décembre 2021

Confusion of nested ifelse expression

Consider below expression:

x$Y = ifelse(x$A<= 5 & abs(x$B) >= 2, 
            ifelse(x$B> 2 ,"YES","NO"),
            'NA')

What I understand is that, if A is <=5 and B >=2 then ALL are YES, if not then NO, but I am confused the second ifelse condition. Any help will be highly appreciated.

Thanks

Aucun commentaire:

Enregistrer un commentaire