columns_to_remove = c('b', 'c', 'd')
df |> select.(-all_of(columns_to_remove))
In general, the above code works. However, if column c does not exist in df in the first place, it will not work.
How can I remove the columns in the list, similar to %in%?