tabit_x: tabit_x

Description Usage Arguments Details Value Examples

Description

Function for cross tabulation of variables within a data.frame or data.frame like.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tabit_x(x, ..., sort = 1, digits = 2, useNA = TRUE)

## S3 method for class 'data.frame'
tabit_x(x, ..., sort = 1, digits = 2, useNA = TRUE)

## S3 method for class 'grouped_df'
tabit_x(x, ..., sort = 1, digits = 2, useNA = TRUE)

## Default S3 method:
tabit_x(x, ..., sort = 1, digits = 2, useNA = "always")

Arguments

x

the thing to be tabulated

...

further optional arguments passed through to methods

sort

should

digits

the number of digits to round percentages to

useNA

whether ro us NAs as value category or not, defaults to TRUE

Details

The data.frame method will take all column value combination for cross tabulation while the grouped_df method is explicitly for tibbles with group information. For those only value combinations for the group columns are relevant.

Value

Returns a data frame with columns zero, one or more columns with value combinations to be cross tabulated by, .count (the number of times a value occurred), .pct (the percentage that value occurred excluding NAs) and .pct_incl_na (the percentage that value occurred including NAs)

Examples

1
2
tabit_x(mtcars)
tabit_x(mtcars[, c("cyl", "am")])

tabit documentation built on March 31, 2020, 5:20 p.m.