Diane
0
Q:

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"))
1

New to Communities?

Join the community