col_stats {campfin}R 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)

[Package campfin version 1.0.11 Index]