Learn R Programming

fritools (version 4.6.0)

count_groups: Count Observations per Groups

Description

I tend to forget the syntax that works with stats::aggregate.

Usage

count_groups(x, ...)

Value

A data.frame with the counts per groups.

Arguments

x

A data.frame.

...

Columns in x.

See Also

Other statistics: column_sums(), powers_of_ten, relative_difference(), round_half_away_from_zero(), sloboda(), weighted_variance()

Examples

Run this code
count_groups(mtcars, "am", "gear")
RUnit::checkEquals(dplyr::count(mtcars, am, gear),
                   count_groups(mtcars, "am", "gear"), checkNames = FALSE)

Run the code above in your browser using DataLab