rtables
0.6.17Reporting Tables
Overview
Reporting tables often have structure that goes beyond simple rectangular data. The 'rtables' package provides a framework for declaring complex multi-level tabulations and then applying them to data. This framework models both tabulation and the resulting tables as hierarchical, tree-like objects which support sibling sub-tables, arbitrary splitting or grouping of data in row and column dimensions, cells containing multiple values, and the concept of contextual summary computations. A convenient pipe-able interface is provided for declaring table layouts and the corresponding computations, and then applying them to data.
New Features
- Added
restrict_facetsfunction factory for use withmake_split_fun@gmbecker - Exported previously internal
make_subset_exprfor use when constructing custom splitting behavior - Exported previously internal
splv_extraandsplv_extra<-accessors for getting and setting child-specific extra arguments onSplitValueobjects. - Exported previously internal
value_expraccessor for retrieving the subsetting expression from aSplitValueorValueWrapperobject. - The
.alt_df*family of afun arguments now receive subsets ofdfwhenalt_counts_dfis not specified in thebuild_tablecall; previously resulted in an error. - Exported previously internal
RefFootnoteconstructor for reference footnote objects. - Added accessor methods for
RowsVerticalSection objects:row_cells,obj_format,obj_format<-,obj_na_str,obj_na_str<-,cell_values - Added
cmethod for directly combiningRowsVerticalSectionobjects - Added vignette: Guided Tour (Advanced) @gmbecker
- Added vignette: Guided Tour (Advanced) - Custom Analysis And Summary Functions @gmbecker
- Added vignette: Guided Tour (Advanced) - Analysis Functions - Split Context @gmbecker
Show all changes in 0.6.17Hide the rest of the changes in 0.6.17
- Added vignette: Guided Tour (Advanced) - Analysis Functions - Combining Existing
afuns @gmbecker - Added vignette: Guided Tour (Advanced) - Analysis Functions - (stub) Useful Building Blocks @gmbecker
- Added vignette: Guided Tour (Advanced) - Custom Split Functions @gmbecker
- Added vignette: Guided Tour (Advanced) - Custom Split Functions - (stub)
make_split_fun@gmbecker - Added vignette: Guided Tour (Advanced) - Custom Split Functions - Behavioral Building Block @gmbecker
- Added vignette: Guided Tour (Advanced) - Custom Split Functions - (stub) Worked Examples @gmbecker
- Added vignette: Guided Tour (Advanced) - (stub)
TableTreeObjects @gmbecker - Added vignette: Guided Tour (Advanced) - (stub)
TableTreeObjects - (stub) Accessing Table Values @gmbecker - Added vignette: Guided Tour (Advanced) - (stub)
TableTreeObjects - (stub) Custom Scoring Functions For Sorting @gmbecker - Added vignette: Guided Tour (Advanced) - (stub)
TableTreeObjects - (stub) Custom Pruning Functions @gmbecker - Added
at_siblingparameter tosplit_rows_by*andanalyzefunctions, enabling placement of a new layout directive as a direct sibling of a previously declared split or analysis @gmbecker - Added
get_anchor_list()function for inspecting the available sibling anchors in an existing layout @gmbecker label_posnow accepts"default"as a value, which resolves to"visible"whenat_siblingis non-NULLand"hidden"otherwise @gmbecker
Bug Fixes
indent_mod<-RowsVerticalSectionmethod now correctly recycles length 1 values @gmbecker- Fixed
uniqify_child_namesemitting messages ending in a literalFALSEdue to passingcall. = FALSEtomessage(), which does not accept that argument @gmbecker - content functions now receive correct
.ref_groupvalue instead of a data.frame with zero rows, when requested. #1117 @gmbecker - Fix in the now exported
RefFootnotein check for disallowed values insymbolargument
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-07
- OK13 OK2026-05-13
Show 4 earlier changesHide 4 earlier changes
- WARNING12 OK, 1 WARNING2026-05-09
- ERROR12 OK, 1 ERROR2026-05-03
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 128 (6 internal)includes a package overview page
- Examples that run
- 100%87 run in a plain check (16 of them under a condition)
- Exported functions with examples
- 74%
- Documented parameters
- 98%
- Return-value docs
- 90%
- Help pages citing references
- 0%
- Introduction to {rtables HTML
- A Guided Tour of rtables - Advanced
- A Guided Tour of rtables - Intermediate
- Advanced rtables - Accessing Values Within a Table
- Advanced rtables - Calling Existing afuns Within Custom afuns
- Advanced rtables - Custom Analysis and Group Summary Functions
- Advanced rtables - Custom Split Functions
- Advanced rtables - Some Complex Split Function Worked Examples
- Advanced rtables - Structure-Conditional Behavior In afuns With .spl_context
- Advanced rtables - Understanding and Interacting With TableTree Objects
Show 28 moreHide 28 vignettes
- Advanced rtables - Useful Behavioral Building Blocks For Complex Custom afuns
- Advanced rtables - Using make_split_fun Effectively
- Advanced rtables - Writing Custom Pruning Functions
- Advanced rtables - Writing Custom Scoring Functions For Sorting
- Advanced rtables - Writing Reusable Behavior Building Blocks
- Column Counts and Formats HTML
- Comparing Against Baselines or Control HTML
- Comparison with dplyr Tabulation HTML
- Constructing rtables Manually HTML
- Controlling Splitting Behavior HTML
- Customizing Appearance HTML
- Example Clinical Trials Tables HTML
- Example Complex Analysis Function: Modelling Cox Regression HTML
- Exploratory Analysis HTML
- Format Precedence and NA Handling HTML
- Generating QC-Ready Result Data Frames (ARDs) from Tables HTML
- Intermediate rtables - Identifying Required Analysis Behavior
- Intermediate rtables - Identifying Required Faceting Behavior
- Intermediate rtables - Translating Shells To Layouts
- Introductory rtables - Basic Table Layout Instructions HTML
- Introductory rtables - Facet And Analysis Nesting HTML
- Introspecting Tables HTML
- Pathing and Table Structure HTML
- Pruning and Sorting Tables HTML
- Subsetting and Manipulating Table Contents HTML
- Tabulation Concepts HTML
- Titles, Footers, and Referential Footnotes HTML
- {rtables HTML
Downloads
Repository
- PRs merged (all time)
- 87%
- Median days to close, 50 most recently updated closed issues
- 36
- Median days to close, 50 most recently updated closed PRs
- 4
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
- github.com/insightsengineering/rtables · last recorded on 2026-09-30
14 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/pharmaverse/rtables on 2026-10-11.
Show all practicesHide 3 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-07-25Commits: at least 1 crediting it in the message
- GitHub Copilotfirst seen on or before 2026-08-25Commits: at least 2 crediting it in the message
- Claude Sonnet 4.61 commit · Jul 2026
Dependencies
Installing rtables adds 11 packages (9 with compiled code, 16 MB of source tarballs). Heaviest: stringi 11 MB, formatters 2.4 MB, rlang 766 KB.
Show all 17 packagesHide all 17 packages
Code & Tests
People & History
Previously maintained by Gabriel Becker (0.3.6 to 0.6.1).
Pick two releases to compare their code metrics.
- 0.6.17Latest2026-10-01 · current release · diff ↗ ·
added 11 exports
splv_extra<-, RefFootnote, SplitValue, get_anchor_dfs, get_full_lyt_df, get_kid_types, get_layout_dfs, get_row_anchor_df, get_row_anchor_list, splv_extra, value_expr - RR 4.6.0 released · 2026-04-24
- 0.6.16
- 0.6.152025-12-14 · diff ↗
- 0.6.142025-11-18 · diff ↗
- 0.6.132025-06-19 · diff ↗ ·
added 7 exports
section_div_at_path<-, has_force_pag, section_div_at_path, section_div_info, subset_cols, tt_normalize_row_path, tt_row_path_exists - 0.6.122025-04-11 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.6.112025-01-10 · diff ↗ ·
removed 9 exports
export_as_docx, margins_landscape, margins_potrait, result_df_specs, section_properties_default, theme_docx_default, theme_html_default, tt_to_flextable, word_mm_to_ptadded 2 exports
obj_stat_names<-, obj_stat_names - 0.6.102024-09-20 · diff ↗ ·
removed 2 exports
section_properties_landscape, section_properties_portraitadded 3 exports
section_properties_default, theme_html_default, word_mm_to_pt - 0.6.92024-06-27 · diff ↗
- 0.6.82024-06-20 · diff ↗ ·
added 9 exports
colcount_na_str<-, colcount_visible<-, facet_colcount<-, facet_colcounts_visible<-, colcount_na_str, colcount_visible, coltree_structure, facet_colcount, rm_all_colcounts - RR 4.4.0 released · 2024-04-24
- 0.6.72024-04-15 · diff ↗ ·
removed 2 exports
summarize_rows, trim_zero_rowsadded 2 exports
top_level_section_div<-, top_level_section_div - 0.6.62023-12-08 · diff ↗ ·
added 12 exports
col_footnotes<-, header_section_div<-, section_div<-, col_footnotes, export_as_docx, header_section_div, margins_landscape, margins_potrait, section_div, section_properties_landscape, section_properties_portrait, theme_docx_default - 0.6.32023-08-30 · diff ↗ ·
removed 1 export
rtables_alignsadded 8 exports
as_result_df, assert_valid_table, find_degen_struct, qtable, qtable_layout, result_df_specs, sanitize_table_struct, validate_table_struct
Show 11 earlier eventsHide 11 earlier events
- 0.6.12023-05-25 · diff ↗ ·
removed 4 exports
[, [<-, export_as_rtf, vpaginate_tableadded 3 exports
ref_symbol<-, ref_symbol, split_rows_by_multivar - RR 4.3.0 released · 2023-04-21
- 0.6.02023-03-03 · diff ↗ ·
removed 2 exports
obj_na_str<-, obj_na_stradded 16 exports
[, [<-, add_combo_facet, add_overall_facet, add_to_split_result, counts_wpcts, drop_facet_levels, export_as_rtf, head, make_split_fun, make_split_result, spl_context_to_disp_path, spl_variable, str, tail, trim_levels_in_facets - 0.5.1
- RR 4.2.0 released · 2022-04-22
- 0.5.02022-04-01 · diff ↗ ·
removed 19 exports
obj_label<-, obj_name<-, var_labels<-, CumulativeCutSplit, VarStaticCutSplit, analyze_against_ref_group, is_rcell_format, list_rcell_format_labels, make_row_df, matrix_form, obj_label, obj_name, propose_column_widths, sprintf_format, toString, var_labels, var_labels_remove, var_relabel, with_labeladded 10 exports
colcount_format<-, indent_mod<-, colcount_format, do_base_split, indent_mod, ref_msg, rtables_aligns, table_shell, table_shell_str, vpaginate_table - 0.4.02021-10-06 · diff ↗ ·
removed 1 export
trim_levels_by_mapadded 15 exports
col_fnotes_here<-, fnotes_at_path<-, label_at_path<-, all_zero, col_fnotes_here, export_as_pdf, insert_row_at_path, label_at_path, path_enriched_df, prune_zeros_only, rawvalues, trim_levels_to_map, tt_to_flextable, value_formats, value_names - 0.3.82021-07-13 · diff ↗ ·
added 16 exports
cell_footnotes<-, ref_index<-, row_footnotes<-, tt_at_path<-, cell_footnotes, clear_indent_mods, df_to_tt, export_as_tsv, export_as_txt, import_from_tsv, ref_index, row_footnotes, trim_levels_by_map, tt_at_path, update_ref_indexing, vars_in_layout - RR 4.1.0 released · 2021-05-18
- 0.3.62021-01-22
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2021-01-22
- Total releases
- 20 / 5 yrs
- License
- Apache License 2.0 | file LICENSE OSI
- Minimum R
- ≥ 4.1
- Download size
- 7.0 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("rtables")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.