Changing names of variables with the function mutate() in dplyr

You can use dplyr::case_when()

Also, for guidelines about how to properly ask homework related questions here, please read our homework policy.