count_count: Count and percentages

View source: R/count_count.R

count_countR Documentation

Count and percentages

Description

Wrapper function to dplyr::count() and dplyr::add_count()

Usage

count_count(data, ..., sort = FALSE, .drop = FALSE)

Arguments

data

A tibble or data frame.

...

data-masking Variables to group by.

sort

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

.drop

For count(): if FALSE will include counts for empty groups (i.e. for levels of factors that don't exist in the data). Deprecated in add_count() since it didn't actually affect the output.

Value

An object of the same type as .data. count() and add_count() group transiently, so the output has the same groups as the input.

Examples

library(palmerpenguins)

count_count(data = penguins,
            species)

count_count(data = penguins,
            species,
            sex)

count_count(data = penguins,
            species,
            sex,
            sort = TRUE)

emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.