tableone: Table One

View source: R/tableone.h.R

tableoneR Documentation

Table One

Description

This function generates a "Table One", a descriptive summary table frequently used in clinicopathological research manuscripts. It supports multiple output styles for flexible formatting.

Usage

tableone(
  data,
  vars,
  sty = "t1",
  excl = FALSE,
  pivot_format = "clinical",
  include_statistics = TRUE,
  group_comparisons = FALSE
)

Arguments

data

The input data as a data frame.

vars

A set of variable names from data to include in the Table One. Supports numeric, ordinal, and categorical variables.

sty

Specify the output style for the table. Each option uses a different package for formatting.

excl

Boolean option to exclude missing values (NA) from the analysis. Note: Exclusion may remove entire cases.

pivot_format

Formatting style for pivottabler enhanced tables.

include_statistics

Include advanced statistical summaries in pivot format.

group_comparisons

Enable group comparison features in pivot table.

Value

A results object containing:

results$todo a html
results$tablestyle1 a preformatted
results$tablestyle2 a html
results$tablestyle3 a html
results$tablestyle4 a html
results$tablestyle5 a html

Examples


# Example usage:
# data('histopathology')
# dat <- as.data.frame(histopathology)
# ClinicoPath::tableone(
#   data = dat,
#   vars = vars(Sex, PreinvasiveComponent, LVI, PNI, Grade, Age),
#   sty = "t3",
#   excl = TRUE)


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