Answers for "dplyr mutate if else"

1

dplyr mutate if else

section <- c("MATH111", "MATH111", "ENG111")
grade <- c(78, 93, 56)
student <- c("David", "Kristina", "Mycroft")
gradebook <- data.frame(section, grade, student)
mutate(gradebook, Pass.Fail = ifelse(grade > 60, "Pass", "Fail"))
Posted by: Guest on April-03-2020

Browse Popular Code Answers by Language