distinct_dt | R Documentation |
Select only unique/distinct rows from a data frame.
distinct_dt(.data, ..., .keep_all = FALSE, fromLast = FALSE)
.data |
data.frame |
... |
Optional variables to use when determining uniqueness. If there are multiple rows for a given combination of inputs, only the first row will be preserved. If omitted, will use all variables. |
.keep_all |
If |
fromLast |
Logical indicating if duplication should be
considered from the reverse side. Defaults to |
data.table
distinct
iris %>% distinct_dt()
iris %>% distinct_dt(Species)
iris %>% distinct_dt(Species,.keep_all = TRUE)
mtcars %>% distinct_dt(cyl,vs)
mtcars %>% distinct_dt(cyl,vs,.keep_all = TRUE)
mtcars %>% distinct_dt(cyl,vs,.keep_all = TRUE,fromLast = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.