cat_desc_table: Compute absolute and relative frequencies for a table.

View source: R/descriptives.R

cat_desc_tableR Documentation

Compute absolute and relative frequencies for a table.

Description

cat_desc_table computes absolute and relative frequencies for categorical data with a number of formatting options.

Usage

cat_desc_table(
  data,
  desc_vars,
  round_desc = 2,
  singleline = FALSE,
  spacer = " ",
  indentor = ""
)

Arguments

data

name of data set (tibble/data.frame) to analyze.

desc_vars

vector of column names for dependent variables.

round_desc

number of significant digits for rounding of descriptive stats.

singleline

Put all group levels in a single line?

spacer

Text element to indent levels and fill empty cells, defaults to " ".

indentor

Optional text to indent factor levels

Value

A tibble with variable names and descriptive statistics.

Examples

cat_desc_table(
  data = mtcars, desc_vars = c("gear", "cyl", "carb"))

cat_desc_table(
  data = mtcars, desc_vars = c("gear", "cyl", "carb"), singleline = TRUE)


wrappedtools documentation built on Oct. 10, 2024, 5:07 p.m.