Table 1 Functions

Functions for creating and modifying Table 1

fmt_table1()

Calculates and formats descriptive statistics for Table 1.

add_comparison()

Adds p-values to the output comparing values across groups

add_overall()

Adds a column with overall summary statistics to an existing fmt_table1 object where descriptive statistics are split by a variable

add_n()

Adds a column with N (or N missing) for each variable

add_stat_label()

Adds a column showing a label for the summary statistics shown in each row

add_q(<fmt_table1>)

Add a column of q values to fmt_table1 object to account for multiple comparisons in Rmarkdown

modify_header(<fmt_table1>)

Modifies header rows for existing fmt_table1 objects.

bold_labels(<fmt_table1>)

Bold or unbold variable labels for fmt_table1 objects in Rmarkdown

bold_levels(<fmt_table1>)

Bold or unbold variable levels for fmt_table1 objects in Rmarkdown

italicize_labels(<fmt_table1>)

Italicize or unitalicize labels for fmt_table1 objects in Rmarkdown

italicize_levels(<fmt_table1>)

Italicize or unitalicize levels for fmt_table1 objects in Rmarkdown

bold_p(<fmt_table1>)

Bold or unbold p-values for fmt_table1 objects in Rmarkdown

inline_text(<fmt_table1>)

Report statistics from fmt_table1 inline in an Rmarkdown document

Regression Model Functions

Functions for formatting regression model results

fmt_regression()

Turn a regression model object into a markdown-ready tibble.

add_global(<fmt_regression>)

Adds the global p-value for a categorical variables in fmt_regression objects

modify_header(<fmt_regression>)

Modifies header rows for existing fmt_regression objects.

bold_labels(<fmt_regression>)

Bold or unbold variable labels for fmt_regression objects in Rmarkdown

bold_levels(<fmt_regression>)

Bold or unbold variable levels for fmt_regression objects in Rmarkdown

italicize_labels(<fmt_regression>)

Italicize or unitalicize labels for fmt_regression objects in Rmarkdown

italicize_levels(<fmt_regression>)

Italicize or unitalicize levels for fmt_regression objects in Rmarkdown

bold_p(<fmt_regression>)

Bold or unbold p-values for fmt_regression objects in Rmarkdown

inline_text(<fmt_regression>) inline_text(<fmt_uni_regression>)

Report statistics from fmt_regression and fmt_uni_regression inline in an Rmarkdown document

fmt_uni_regression()

Creates table of univariate regression results

add_global(<fmt_uni_regression>)

Adds the global p-value for a categorical variables in fmt_uni_regression objects

add_q(<fmt_uni_regression>)

Add a column of q values to fmt_uni_regression object to account for multiple comparisons

modify_header(<fmt_uni_regression>)

Modifies header rows for existing fmt_uni_regression objects.

bold_labels(<fmt_uni_regression>)

Bold or unbold variable labels for fmt_uni_regression objects in Rmarkdown

bold_levels(<fmt_uni_regression>)

Bold or unbold variable levels for fmt_uni_regression objects in Rmarkdown

italicize_labels(<fmt_uni_regression>)

Italicize or unitalicize labels for fmt_uni_regression objects in Rmarkdown

italicize_levels(<fmt_uni_regression>)

Italicize or unitalicize levels for fmt_uni_regression objects in Rmarkdown

bold_p(<fmt_uni_regression>)

Bold or unbold p-values for fmt_uni_regression objects in Rmarkdown

fmt_beta()

Round and format regression model coefficients

General Formatting Functions

Functions for formatting

fmt_percent()

Formats percentages to be displayed in tables or text of report.

fmt_pvalue()

Formats p-values to be displayed in tables or text of report.

indent_key(<fmt_regression>)

Makes index of factor variables requiring indent from fmt_regression objects in Rmarkdown

indent_key(<fmt_table1>)

Makes index of factors requiring indent from fmt_table1 objects in Rmarkdown

indent_key(<fmt_uni_regression>)

Makes index of factor variables requiring indent from fmt_regression objects in Rmarkdown

indent_key()

Make indices compatible with add_indent

row_to_name()

Renames columns to values in a row of data frame

as_tibble(<fmt_regression>) as_data_frame.fmt_regression()

Convert fmt_regression objects to data frame

as_tibble(<fmt_table1>) as_data_frame.fmt_table1()

Convert fmt_table1 objects to data frame

as_tibble(<fmt_uni_regression>) as_data_frame.fmt_uni_regression()

Convert fmt_uni_regression objects to data frame

Default Printing Methods

R console and Rmarkdown print defaults

print(<fmt_regression>)

Print fmt_regression objects

print(<fmt_table1>)

Print fmt_table1 objects

print(<fmt_uni_regression>)

Print fmt_uni_regression objects

knit_print(<fmt_regression>)

Print fmt_regression objects in Rmarkdown

knit_print(<fmt_table1>)

Print fmt_table1 objects in Rmarkdown

knit_print(<fmt_uni_regression>)

Print fmt_uni_regression objects in Rmarkdown

knit_print

A custom printing function for Rmarkdown

Imports

Functions imported from other packages

%>%

magrittr Pipe operator %>%

as_tibble

The tibble package's as_tibble function

as_data_frame

The tibble package's as_data_frame function is an alias for tibble::as_tibble

S3 Generic Functions

Class-based method functions

add_global()

Adds the global p-value for a categorical variables

add_q()

Add a column of q values to objects to account for multiple comparisons

modify_header()

Modifies header rows for existing fmt_table1, fmt_regression, and fmt_uni_regression objects

bold_labels()

Bold variable labels in Rmarkdown

bold_levels()

Bold variable levels in Rmarkdown

italicize_labels()

Italicize variable labels in Rmarkdown

italicize_levels()

Italicize variable levels in Rmarkdown

bold_p()

Bold significant p-values in Rmarkdown

inline_text()

Report statistics from fmt_table1 and fmt_regression inline in an Rmarkdown document

Example Datasets

Simulated data to illustrate package use

trial

Results from a simulated trial of Placebo vs Drug