vendredi 1 juin 2018

dplyr if_else() vs base R ifelse()

I am fairly proficient within the Tidyverse, but have always used ifelse() instead of dplyr if_else(). I want to switch this behavior and defualt to always using dplyr::if_else() and deprecating ifelse() from my code.

Is there any reason not to do this? Would this likely get me into trouble? I'll spare you the details, but recently, not using if_else() screwed me up, when I unknowingly created a column of character matrices in my data analysis. If I switch to always using if_else() I hope to avoid this issue in the future.

Aucun commentaire:

Enregistrer un commentaire