distinct | R Documentation |
Retain only unique/distinct rows from an input df.
distinct(.df, ..., .keep_all = FALSE)
.df |
A data.frame or data.table |
... |
Columns to select before determining uniqueness. If omitted, will use all columns.
|
.keep_all |
Only relevant if columns are provided to ... arg. This keeps all columns, but only keeps the first row of each distinct values of columns provided to ... arg. |
df <- tidytable(
x = 1:3,
y = 4:6,
z = c("a", "a", "b")
)
df %>%
distinct()
df %>%
distinct(z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.