fdistinct {timeplyr}R Documentation

Find distinct rows

Description

Like dplyr::distinct() but faster when lots of groups are involved.

Usage

fdistinct(
  data,
  ...,
  .keep_all = FALSE,
  sort = FALSE,
  order = sort,
  .by = NULL,
  .cols = NULL
)

Arguments

data

A data frame.

...

Variables used to find distinct rows.

.keep_all

If TRUE then all columns of data frame are kept, default is FALSE.

sort

Should result be sorted? Default is FALSE. When order = FALSE this option has no effect on the result.

order

Should the groups be calculated as ordered groups? Setting to TRUE may sometimes offer a speed benefit, but usually this is not the case. The default is FALSE.

.by

(Optional). A selection of columns to group by for this operation. Columns are specified using tidy-select.

.cols

(Optional) alternative to ... that accepts a named character vector or numeric vector. If speed is an expensive resource, it is recommended to use this.

Value

A data.frame of distinct groups.

See Also

group_collapse duplicate_rows

Examples

library(dplyr)
library(timeplyr)
library(ggplot2)

mpg %>%
  distinct(manufacturer)
mpg %>%
  fdistinct(manufacturer)


[Package timeplyr version 0.8.1 Index]