Select distinct/unique rows in data.table
Analogous function for distinct
in dplyr
distinct(.data, ..., .keep_all = FALSE)
.data |
data.table |
... |
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 |
data.table
a = as.data.table(iris) b = as.data.table(mtcars) a %>% distinct(Species) b %>% distinct(cyl,vs,.keep_all = TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.