count_arrange: 'dplyr::count()' + 'dplyr::arrange()'

Description Usage Arguments Details Value Borrowing from the {tidyverse} See Also

View source: R/dplyr-combos.R

Description

Shorthand for {dplyr} functions called consecutively.

Usage

1
count_arrange(data, ..., sort = FALSE, .by_group = FALSE)

Arguments

data

A 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.

sort

if TRUE will sort output in descending order of n

.by_group

If TRUE, will sort first by grouping variable. Applies to grouped data frames only.

Details

Note that arranging is performed on the column used to compute the value for dplyr::count(), which is different than simply calling dplyr::count(x, ..., sort = TRUE) (which sorts by the output column n). For this reason, no sort option is provided (to prevent the user from mistakenly using this function in such a manner).

Value

A tibble.

Borrowing from the {tidyverse}

The logic for handling ... is borrowed from a review of the internals for tidyr::unite() and tidyr::gather().

See Also

Other dplyr-combos: arrange_distinctly, pull_distinctly


tonyelhabr/tetidy documentation built on May 29, 2019, 3:18 p.m.