count_agg: Count aggregates (extended version of dplyr::count).

Description Usage Arguments Value Examples

View source: R/stats.R

Description

Count aggregates (extended version of dplyr::count).

Usage

1
count_agg(data, ..., total_value = "Total")

Arguments

data

A data frame.

...

Variables to group by.

total_value

The total value label.

Value

A tbl, grouped the same way as data.

Examples

1
2
3
4
5
6
data <- dplyr::tibble(
  var1 = as.character(c(1, 1, 2, 2)),
  var2 = as.character(c(1, 2, 1, 2)),
  var3 = as.character(c(1, 2, 2, 2))
)
divr::count_agg(data, var1, var2)

stephLH/divr documentation built on Feb. 19, 2020, 9:38 p.m.