View source: R/colwise-distinct.R
distinct_all | R Documentation |
Scoped verbs (_if
, _at
, _all
) have been superseded by the use of
pick()
or across()
in an existing verb. See vignette("colwise")
for
details.
These scoped variants of distinct()
extract distinct rows by a
selection of variables. Like distinct()
, you can modify the
variables before ordering with the .funs
argument.
distinct_all(.tbl, .funs = list(), ..., .keep_all = FALSE)
distinct_at(.tbl, .vars, .funs = list(), ..., .keep_all = FALSE)
distinct_if(.tbl, .predicate, .funs = list(), ..., .keep_all = FALSE)
.tbl |
A |
.funs |
A function |
... |
Additional arguments for the function calls in
|
.keep_all |
If |
.vars |
A list of columns generated by |
.predicate |
A predicate function to be applied to the columns
or a logical vector. The variables for which |
The grouping variables that are part of the selection are taken into account to determine distinct rows.
df <- tibble(x = rep(2:5, each = 2) / 2, y = rep(2:3, each = 4) / 2)
distinct_all(df)
# ->
distinct(df, pick(everything()))
distinct_at(df, vars(x,y))
# ->
distinct(df, pick(x, y))
distinct_if(df, is.numeric)
# ->
distinct(df, pick(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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.