library(dplyr)
data(survey_data)
# How many items did each respondent answer with the highest value (5)?
survey_data <- survey_data %>%
mutate(n_top = row_count(., trust_government, trust_media,
trust_science, count = 5))
Run the code above in your browser using DataLab