Fast Unique Elements / Rows
funique
is a substantially faster alternative to unique
. It is generic with a default vector method and a data frame method.
funique(x, ...) ## Default S3 method: funique(x, sort = FALSE, method = c("auto", "radix", "hash"), ...) ## S3 method for class 'data.frame' funique(x, cols = NULL, sort = FALSE, ...)
x |
a atomic vector or data frame / list of equal-length columns. |
|||||||||||||||||||||
sort |
logical. |
|||||||||||||||||||||
method |
an integer or character string specifying the method of computation:
|
|||||||||||||||||||||
cols |
compute unique rows according to a subset of columns. Columns can be selected using column names, indices, a logical vector or a selector function (i.e. |
|||||||||||||||||||||
... |
arguments passed to |
If x
is a data frame / list and all rows are already unique, then x
is returned. Otherwise a copy of x
with duplicate rows removed is returned. See qF
for some additional computational details.
x
with duplicate elements/rows removed.
funique(mtcars$cyl) funique(gv(mtcars, c(2,8,9))) funique(mtcars, cols = c(2,8,9))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.