edar_bundle_cat: Smart univariate summary of the categorical variables

edar_bundle_catR Documentation

Smart univariate summary of the categorical variables

Description

This function summarizes the distribution of the non-numerical variables. It bundles together all the variables that have the same categories and displays their summary in a single table.

Usage

edar_bundle_cat(
  data,
  vars = NULL,
  print.summary = NULL,
  weight = NULL,
  digits = 4,
  width.size = 150
)

Arguments

data

a data frame

vars

a vector with the name of the variables to display. If none is provided (vars=NULL), it summarizes all the categorical variables

print.summary

boolean, if TRUE the function will print a summary

weight

vector with the weights

digits

integer, the number of digits to print

width.size

numeric, size of the columns in the screen to print the results

print

a string with the type of summary to print in the screen (see value below for the complete description of the return). Values can be one of 'prop' (display the proportions), 'count' (display the counts), or 'prop_count' (display both the proportion and counts).

Value

It retuns a tibble in which the columns are lists. The columns of the tibble are var.idx, which is a list with the idx of the variables, vars, which is a list with the variable names bundled together. Finally table.p, table.n, and table.pn are the tables with, respectively, the proportions, counts, and both proportions and counts for the bundled variables

Examples

data(edar_survey)
edar_bundle_cat(edar_survey)
tb = edar_bundle_cat(edar_survey )
tb
tb$var.idx
tb$table.n
tb$table.p
tb$table.pn

# with pipe:
# edar_survey %>% edar_bundle_cat()


DiogoFerrari/edar documentation built on May 8, 2022, 8:26 a.m.