creating a function to find two values across several columns and create a new column in r
I have a function that will search several columns for a value and create a new column in r but I need it to find two values.
term.func <- function(df,new.col, term){
df %>%
mutate({{new.col}} := any(c_across(c(enrollment_term_t1:enrollment_term_t11))
== term))
}