I am trying to pass a character variable called "col" to dplyr::distinct() to designate the column for it to use to determine distinctness. What is the correct syntax? Each of the following are problematic:
df <- df |> distinct(col, .keep_all = T) ...
... reports an error that col is not a column in df (as expected)
df <- df |> distinct(pick(col), .keep_all = T) ...
... warns that "using an external vector in selections was deprecated in tidyselect 1.1.0. Please use all_of() or any_of instead.
df <- df |> distinct(all_of(col), .keep_all = T) ...
... warns that "using all_of() outside of a selecting function was deprecated in tidyselect 1.2.0."