Skip to contents

Argument Conventions

The following dummy functions are unexported and used to document argument conventions in the framework.

lyt_args()
Layouting function argument conventions
constr_args()
Constructor argument conventions
compat_args()
Compatibility argument conventions
gen_args()
General argument conventions
sf_args()
Split function argument conventions

Layout and Tabulation

Functions for declaring layout and tabulation

qtable_layout() qtable()
Generalized frequency table
build_table()
Create a table from a layout and data
basic_table()
Layout with 1 column and zero rows
analyze()
Generate rows analyzing variables across columns
append_topleft()
Append a description to the 'top-left' materials for the layout
split_cols_by()
Declaring a column-split based on levels of a variable
add_colcounts()
Add the column population counts to the header
split_rows_by()
Add rows according to levels of a variable
summarize_row_groups()
Add a content row of summary counts
split_cols_by_multivar()
Associate multiple variables with columns
split_rows_by_multivar()
Associate multiple variables with rows
analyze_colvars()
Generate rows analyzing different variables across columns
split_cols_by_cuts() split_rows_by_cuts() split_cols_by_cutfun() split_cols_by_quartiles() split_rows_by_quartiles() split_rows_by_cutfun()
Split on static or dynamic cuts of the data
add_overall_col()
Add overall column
add_existing_table()
Add an already calculated table to the layout
table_inset() `table_inset<-`()
Access or (recursively) set table inset (from formatters)

Tabulation Utility Functions

Functions that are useful to be used with the analyze* functions.

in_rows()
Create multiple rows in analysis or summary functions
additional_fun_params
Additional parameters within analysis and content functions (afun/cfun)
simple_analysis()
Default tabulation
make_afun()
Create a custom analysis function wrapping an existing function
list_wrap_x() list_wrap_df()
Returns a function that coerces the return values of a function to a list
spl_context
.spl_context within analysis and split functions
spl_context_to_disp_path()
Translate spl_context to a path to display in error messages
counts_wpcts()
Analysis function to count levels of a factor with percentage of the column total

Split Functions

add_overall_level() select_all_levels add_combo_levels()
Add overall or combination levels to split groups
keep_split_levels() remove_split_levels() drop_split_levels() drop_and_remove_levels() reorder_split_levels() trim_levels_in_group()
Split functions
trim_levels_to_map()
Trim levels to map
custom_split_funs
Custom split functions
do_base_split()
Apply basic split (for use in custom split functions)

Custom Split Functions

make_split_fun()
Create a custom splitting function
drop_facet_levels()
Pre-processing function for use in make_split_fun
trim_levels_in_facets()
Trim levels of another variable from each facet (post-processing split step)
add_combo_facet() add_overall_facet()
Add a combination facet in post-processing
make_split_result() add_to_split_result()
Construct split result object
spl_variable()
Variable associated with a split

cell formatting.

format_rcell()
Format rcell objects
value_formats()
Value formats

Table Structure Information

nrow(<VTableTree>) ncol(<VTableNodeInfo>) dim(<VTableNodeInfo>)
Table dimensions
row_paths() col_paths()
Get a list of table row/column paths
row_paths_summary() col_paths_summary()
Print row/column paths summary
table_structure()
Summarize table
table_shell() table_shell_str()
Table shells
make_row_df()
Make row layout summary data frames for use during pagination (from formatters)
make_col_df()
Column layout summary

Layout Structure Information

vars_in_layout()
List variables required by a pre-data table layout
coltree_structure()
Display column tree structure

Access and Modify

cell_values() value_at()
Retrieve cell values by row and column path
top_left() `top_left<-`()
Top left material
rbindl_rtables() rbind(<VTableNodeInfo>) rbind2(<VTableNodeInfo>,<ANY>)
Row-bind TableTree and related objects
cbind_rtables()
Column-bind two TableTree objects
as.vector(<VTableTree>)
Convert to a vector
`[<-`(<VTableTree>,<ANY>,<ANY>,<list>) `[`(<VTableTree>,<logical>,<logical>)
Retrieve and assign elements of a TableTree
clear_indent_mods()
Clear all indent modifiers from a table
head() tail()
Head and tail methods
section_div() `section_div<-`() header_section_div() `header_section_div<-`() top_level_section_div() `top_level_section_div<-`()
Section dividers accessor and setter
colcount_visible() `colcount_visible<-`()
Value and Visibility of specific column counts by path
facet_colcount() `facet_colcount<-`()
Get or set column count for a facet in column space
`facet_colcounts_visible<-`()
Set visibility of column counts for a group of sibling facets
rm_all_colcounts()
Set all column counts at all levels of nesting to NA

Validating and Fixing Table Structure

validate_table_struct() assert_valid_table() experimental
Validate and assert valid table structure
sanitize_table_struct() experimental
Sanitize degenerate table structures
find_degen_struct() experimental
Find degenerate (sub)structures within a table

Sorting and Pruning

prune_table()
Recursively prune a TableTree
all_zero_or_na() all_zero() content_all_zeros_nas() prune_empty_level() prune_zeros_only() low_obs_pruner()
Trimming and pruning criteria
trim_rows()
Trim rows from a populated table without regard for table structure
sort_at_path()
Sorting a table at a specific path
cont_n_allcols() cont_n_onecol()
Score functions for sorting TableTrees

Compatibility Layer

These functions provide some backwards compatibility to the previous (pre 2021) rtables framework.

rtable() rtablel()
Create a table
rrow()
Create an rtable row
rcell() non_ref_rcell()
Cell value constructors
rheader()
Create a header
rrowl()
Create an rtable row from a vector or list of values
indent()
Change indentation of all rrows in an rtable
df_to_tt()
Create an ElementaryTable from a data.frame

Output Functions

These functions create ascii or html representations of the table

as_html()
Convert an rtable object to a shiny.tag HTML object
export_as_tsv() import_from_tsv()
Create enriched flat value table with paths
toString(<VTableTree>)
Convert an rtable object to a string
get_formatted_cells() get_cell_aligns()
Get formatted cells
as_result_df() path_enriched_df()
Generate a result data frame

Utility Functions

utility functions

Viewer()
Display an rtable object in the Viewer pane in RStudio or in a browser
compare_rtables()
Compare two rtables
indent_string()
Indent strings
is_rtable()
Check if an object is a valid rtable

Pagination

Pagination related functionality

pag_tt_indices() paginate_table()
Pagination of a TableTree
make_row_df()
Make row layout summary data frames for use during pagination (from formatters)
make_col_df()
Column layout summary

TableTree Framework Accessor Functions

content_table() `content_table<-`()
Retrieve or set content table from a TableTree
tree_children() `tree_children<-`()
Retrieve or set the direct children of a tree-style object
collect_leaves()
Collect leaves of a TableTree
obj_avar() row_cells() `row_cells<-`() row_values() `row_values<-`()
Row attribute accessors
no_colinfo()
Exported for use in tern
clayout() `clayout<-`() col_info() `col_info<-`() coltree() col_exprs() col_counts() `col_counts<-`() col_total() `col_total<-`()
Column information/structure accessors
horizontal_sep() `horizontal_sep<-`()
Access or recursively set header-body separator for tables
table_inset() `table_inset<-`()
Access or (recursively) set table inset (from formatters)
main_title() `main_title<-`() subtitles() `subtitles<-`() page_titles() `page_titles<-`() main_footer() `main_footer<-`() prov_footer() `prov_footer<-`() all_footers() all_titles()
General title and footer accessors (from formatters)
top_left() `top_left<-`()
Top left material
obj_name() `obj_name<-`() obj_label() `obj_label<-`() obj_format() `obj_format<-`() obj_na_str() `obj_na_str<-`() obj_align() `obj_align<-`()
Label, name, and format accessor generics (from formatters)

TableTree Framework Constructors and S4 Classes

S4 classes and constructors

manual_cols()
Manual column declaration
CellValue()
Constructor for Cell Value
EmptyColInfo EmptyElTable EmptyRootSplit EmptyAllSplit
Empty table, column, split objects
ManualSplit()
Manually defined split
MultiVarSplit()
Split between two or more different variables
VarLevelSplit() VarLevWBaselineSplit()
Split on levels within a variable
AnalyzeVarSplit() AnalyzeColVarSplit() AnalyzeMultiVars()
Define a subset tabulation/analysis
make_static_cut_split() VarDynCutSplit()
Splits for cutting by values of a numeric variable
InstantiatedColumnInfo()
Instantiated column info
LabelRow() .tablerow() DataRow() ContentRow()
Row classes and constructors
ElementaryTable() TableTree()
TableTree classes

Pathing and insertion related functions

label_at_path() `label_at_path<-`()
Label at path
tt_at_path() `tt_at_path<-`()
Access or set table elements at specified path
insert_row_at_path()
Insert row at path

Referential Footnotes

Functions related to referential footnotes

Result Data Frame Functions

Functions for generating result data frames from rtables TableTree objects

as_result_df() path_enriched_df()
Generate a result data frame