reportcat: Summary of Categorical Variables

View source: R/reportcat.h.R

reportcatR Documentation

Summary of Categorical Variables

Description

Generates a detailed summary of categorical variables including counts, percentages, and missing value information. The output is presented in both textual and visual formats, making it easy to interpret the distribution of your data.

Usage

reportcat(
  data,
  vars,
  sumvar_style = FALSE,
  show_proportions = TRUE,
  sort_by_frequency = FALSE
)

Arguments

data

The data as a data frame.

vars

Select the variables from your data frame that you wish to summarize. Only categorical variables (nominal, ordinal, or factors) are allowed.

sumvar_style

If TRUE, provides comprehensive categorical analysis similar to sumvar package's tab1() function with enhanced frequency tables and percentage breakdowns.

show_proportions

If TRUE, shows proportions alongside counts in the summary.

sort_by_frequency

If TRUE, categories are sorted by frequency (most common first).

Value

A results object containing:

results$todo a html
results$text a html
results$text1 a html

Examples


# Example usage:
# 1. Load your data into a data frame.
# 2. Select the categorical variables to summarize.
# 3. Run the reportcat module to view the summary.
#
# The module will produce a styled textual report along with a visual summary table.


sbalci/ClinicoPathDescriptives documentation built on July 4, 2025, 5:25 p.m.