Changelog
Source:NEWS.md
tsg 0.1.4
New features
-
generate_crosstab()gainsmultiple_columnsandmultiple_columns_filterarguments. Whenmultiple_columns = TRUE(requires at least 2 columns in...), each column is treated as a binary indicator: rows where the column equalsmultiple_columns_filter(default1L) are counted perxcategory and presented as side-by-side frequency/percent columns in a single wide table. All grouping options (group_as_list,calculate_per_group,group_as_hierarchy) are supported. -
generate_crosstab()gains amultiple_columns_typeargument (default"default"). Whenmultiple_columns = TRUEandmultiple_columns_type = "stacked", the columns supplied in...are combined as a two-level hierarchical pivot: each level-1 category gets a subtotal column pair (frequency + percent), and the level-2 categories produce individual column pairs beneath it. Column labels follow the pattern"Frequency__<level-1 label>__<level-2 label>". The top-level spanner groups all frequency columns first, followed by all percent/proportion columns. -
generate_output()now produces HTML (via thegtpackage) and PDF outputs, with proper spanner/header handling for cross-tabulated tables and consistent numeric formatting matching the XLSX output. -
generate_frequency()andgenerate_crosstab(): setting bothgroup_as_list = TRUEandgroup_as_hierarchy = TRUEnow returns a nested named list with a grand-total entry at each level (no warning). The total entry key is formatted as"{var_label}: {label_group_hierarchy}". Previously,group_as_listwas silently overridden with a warning. -
Facade unification across formats: The facade system (
add_facade(),get_tsg_facade()) now applies consistently across XLSX, HTML, and Word output.get_tsg_facade(which = "html")andget_tsg_facade(which = "docx")load format-specific defaults from new built-in YAML files (inst/extdata/facade/html/default.yaml,inst/extdata/facade/docx/default.yaml). Per-tableadd_facade()overrides are merged into all output formats automatically. -
resolve_facade()gains awhichargument for format-aware fallback when resolving user overrides. -
gt_apply_facade()(HTML renderer) now supports the full cross-format key set:body.*,header.*,spanner.*,col_first.*,col_last.*,row_group.*,source_note.*,footnotes.*,border_outer.*,border_header.*, andtable.lastRowBold. -
tsg_to_flextable()(Word renderer) gains full facade key coverage with flextable-native styling.
Bug fixes
- Fixed
get_tsg_facade()throwingobject 'facade_path' not foundwhen called with a named facade that does not exist in the built-in YAML directory (#9). - Fixed
sort_exceptingenerate_frequency()being applied only to the first variable when two or more variables are supplied (#8). - Fixed incorrect cumulative frequency and percent/proportion values when
position_total = "top"ingenerate_frequency()— cumulative columns are now set toNAfor the total row when it is placed at the top (#6).
Documentation
- All four vignettes rewritten for clarity and accessibility: goal-oriented section headers, plain-English introductions, and motivation-before-mechanics structure throughout.
- Getting Started with tsg (was: Introduction)
- Saving and Sharing Your Tables (was: Generating Outputs in Different Formats)
- Customizing How Your Tables Look (was: Customizing Output with Facade)
- Grouped Tables and Side-by-Side Comparisons (was: Advanced Features)
Internal changes
- Refactored
generate_frequency()andgenerate_crosstab()to remove self-recursion. Both functions now use extractedfreq_compute_group()andcrosstab_compute_group()helpers with a nest/map/unnest approach, eliminating duplicated pipeline code and improving maintainability. - Added internal helpers
val_to_group_key()andbuild_nested_group_list()to support recursive nested-list construction.
tsg 0.1.3
CRAN release: 2026-02-28
- Fixed bugs when generating table using character labelled/factored variables.
tsg 0.1.2
CRAN release: 2026-02-22
Features
- Added experimental feature with an option to include grand total when generating tables with grouping for both
generate_frequency()andgenerate_crosstab() -
generate_crosstab()now allows 1 or more variables to be specified in thexargument for hierarchical grouping. - Added
<- backhyperlink in the generated Excel output when table list is included.
tsg 0.1.1
CRAN release: 2026-02-12
Features
- Implemented new way of adding facade to the generated Excel output.
- Added
generate_template()for generating facade and table-list templates.