How to combine the across () function with mutate () and case_when () to mutate values in multiple columns according to a condition?
问题 I have demographic data set, which includes the age of people in a household. This is collected via a survey and participants are allowed to refuse providing their age. The result is a data set with one household per row (each with a household ID code), and various household characteristics such as age in the columns. Refused responses as coded as "R", and you could re-create a sample using the code below: df <- list(Household_ID = c("1A", "1B", "1C", "1D", "1E"), AGE1 = c("25", "47", "39",