dplyr if_else(): Create new variable from existing variable

With dplyr’s if_else() function, we can create a new variable based on the values of another variable. if_else() function in dplyr takes in a condition as input and can assign a value based on the condition is true or false. In this example, we will use dplyr’s if_else() to categorise or dichotomise a numerical variable… Continue reading dplyr if_else(): Create new variable from existing variable

Exit mobile version