Learn R Programming

RastaRocket (version 1.0.1)

add_missing_info: Add missing value information to a gtsummary table

Description

This function adds information about missing and non-missing data counts to a gtsummary table. It can also apply custom statistics by group and modify the table body with an external function.

Usage

add_missing_info(
  base_table,
  show_missing_data,
  var_group = NULL,
  by_group = FALSE
)

Value

A gtsummary table object with missing value information and modifications applied.

Arguments

base_table

A gtsummary table object.

show_missing_data

Logical. If TRUE, shows the number of non-missing and missing values with percentages. If FALSE, shows only non-missing values.

var_group

Optional. A grouping variable name. If not NULL, additional stats are added by group.

by_group

A boolean (default is FALSE) to analyse by group.