col_stats: Apply a statistic function to all column vectors

View source: R/col-stats.R

col_statsR Documentation

Apply a statistic function to all column vectors

Description

Apply a counting summary function like dplyr::n_distinct() or count_na() to every column of a data frame and return the results along with a percentage of that value.

Usage

col_stats(data, fun, print = TRUE)

glimpse_fun(data, fun, print = TRUE)

Arguments

data

A data frame to glimpse.

fun

A function to map to each column.

print

logical; Should all columns be printed as rows?

Value

A tibble with a row for every column with the count and proportion.

Examples

col_stats(dplyr::storms, dplyr::n_distinct)
col_stats(dplyr::storms, campfin::count_na)

campfin documentation built on Oct. 20, 2023, 5:06 p.m.