sanitize_table_struct: Sanitize degenerate table structures

View source: R/validate_table_struct.R

sanitize_table_structR Documentation

Sanitize degenerate table structures

Description

[Experimental]

Experimental function to correct structure of degenerate tables by adding messaging rows to empty sub-structures.

Usage

sanitize_table_struct(tt, empty_msg = "-- This Section Contains No Data --")

Arguments

tt

(TableTree)
a TableTree object.

empty_msg

(string)
the string which should be spanned across the inserted empty rows.

Details

This function locates degenerate portions of the table (including the table overall in the case of a table with no data rows) and inserts a row which spans all columns with the message empty_msg at each one, generating a table guaranteed to be non-degenerate.

Value

If tt is already valid, it is returned unmodified. If tt is degenerate, a modified, non-degenerate version of the table is returned.

See Also

Other table structure validation functions: find_degen_struct(), validate_table_struct()

Examples

sanitize_table_struct(rtable("cool beans"))

lyt <- basic_table() %>%
  split_cols_by("ARM") %>%
  split_rows_by("SEX") %>%
  summarize_row_groups()

## Degenerate because it doesn't have any analyze calls -> no data rows
badtab <- build_table(lyt, DM)
sanitize_table_struct(badtab)


Roche/rtables documentation built on April 30, 2024, 11:18 p.m.