count_vars: Count Each Variables in a Data Frame

Description Usage Arguments Value Examples

View source: R/explore.R

Description

Count all or many variables in a data.frame (depth 1 level) and display the results as list of data.frame. This function intended for interactive use.

Usage

1
count_vars(x, ..., sort = TRUE, name = NULL, prop = FALSE)

Arguments

x

A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).

...

Variables to count (one level); If not supply, count all variables.

sort

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

name

The name of the new column in the output.

prop

If TRUE calculate proprotion for each count.

Value

A named list of data.frame

Examples

1
2
3
4
# Count All variables
count_vars(iris)
# Count Specified variables
count_vars(iris, Species, Sepal.Length)

Lightbridge-AI/lbr documentation built on Dec. 27, 2021, 8:09 p.m.