count2 {k5}R Documentation

Count the way you want

Description

A wrapper around dplyr::count() with sort set to TRUE by default and the an additional column created by default containing the proportional fraction each observation makes of the whole.

Usage

count2(x, ..., wt = NULL, sort = TRUE, prop = TRUE, sum = NULL)

count_vec(x, sort = TRUE, prop = TRUE, sum = NULL)

Arguments

x

A data frame.

...

Variables to group by.

wt

Frequency weights.

sort

If TRUE, will show the largest groups at the top.

prop

If TRUE, compute the fraction of marginal table.

sum

Column to replace with a cumulative sum (n, p, or np).

Value

A tibble of element counts

Examples

count2(iris, Species)

[Package k5 version 0.2.1 Index]