df <- tibble(x = rep(2:5, each = 2) / 2, y = rep(2:3, each = 4) / 2)
distinct_all(df)
# ->
distinct(df, across())
distinct_at(df, vars(x,y))
# ->
distinct(df, across(c(x, y)))
distinct_if(df, is.numeric)
# ->
distinct(df, across(where(is.numeric)))
# You can supply a function that will be applied before extracting the distinct values
# The variables of the sorted tibble keep their original values.
distinct_all(df, round)
# ->
distinct(df, across(everything(), round))
Run the code above in your browser using DataLab