table_df: Tabulate a Data Frame/Matrix

Description Usage Arguments Value Examples

View source: R/Summarize.R

Description

Calls the table function on each column in a data frame/matrix, but only for columns with up to a certain number of unique values.

Usage

1
table_df(data, max_distinct = 250, group = TRUE, useNA = "ifany", dnn = NULL)

Arguments

data

A data frame/matrix.

max_distinct

Maximum number of unique elements to return ungrouped (integer).

group

Whether or not to group columns with more than max_distinct (logical) (unimplemented).

useNA

Value to pass to table to determine whether or not to use NA values (one of "no", "ifany", and "always").

dnn

Value to be passed to the table function (dimension names of the resulting table).

Value

List of tables.

Examples

1
2
3
4
5
6
table_df(mtcars)
table_df(as.matrix(mtcars))
table_df(mtcars$mpg)
table_df(c(1, 2, 3, NA, NA))
table_df(c(1, 2, 3, NA, NA), useNA = "no")
table_df(c(1, 2, 3, NA, NA), useNA = "always")

KO112/KO documentation built on Oct. 2, 2020, 9:21 a.m.