rtables 0.6.7
CRAN release: 2024-04-15
New Features
- Added
top_level_section_divforbasic_tableto set section dividers for top level rows. - Added
keep_label_rowstoas_result_dfto have these lines visible. -
sort_at_pathnow gives informative error messages when the given path does not exist.
Bug Fixes
- Fixed
rlistingsdecoration (e.g. titles and footers) expansion when there are new lines. Moved relevant handling fromrtables’matrix_formfunction toformatters’ dedicatedmform_handle_newlinesfunction. - Fixed issue with
rtables_rootnot being removed when usingas_result_df. - Fixed edge case bug in
as_result_dfwhere rows of the table have only"root"as path index. - Fixed
sort_at_pathpathing to ignore leading"root"element (regardless of actual root element name) to match currenttt_at_pathbehavior. - Fixed
section_divfor analysis of multiple variables (AnalyzeMultiVars). - Fixed mismatch between indentation declared in row info (
mf_rinfo(mf)) and actual selected indentation frommatrix_form(mf, indent_rownames = FALSE).
rtables 0.6.6
CRAN release: 2023-12-08
New Features
- Removed
ref_groupreordering in column splits so not to change the order. - Added
boldargument toas_htmlto bold specified elements, andheader_sep_lineargument to print a horizontal line under the table header in rendered HTML output. - Duplicate referential footnotes are consolidated when tables are rendered.
- Section divisors can be set for analysis rows.
- Added setter and getter for section dividers (
section_divandsection_div<-). They also accept split section structure assignment. - Added
header_section_divsetters and getters for layout and table objects along with relatedbasic_tableparameter. - Added
na_strargument toanalyze_colvarsto set custom string to print in place of missing values. - Added flat
data.frameoutputs foras_result_df()via flag parametersas_viewer,as_strings, andexpand_colnames. - Migrated
export_as_pdffunction toformatters.
Bug Fixes
- Fixed a bug that was failing when wrapping and section dividers were used at the same time.
- Fixed a bug in
as_result_dfcausing misalignment of column names. - Fixed a bug that was not allowing path indexing as
row_paths()was giving a different path due to it being made of named values. - Fixed a bug in
as_result_dfwhen called on tables with less than 3 rows.
Miscellaneous
- Applied
stylerand resolved package lint. Changed default indentation from 4 spaces to 2. - Added Developer Guide with Debugging, Split Machinery, and Tabulation sections.
- Whitespace is not trimmed when rendering tables with
as_html. - Started deprecation cycle for
col_fnotes_hereto be replaced withcol_footnotes. - Exported
section_divmethods now have a dedicated documentation page that is visible to users. - When tables are exported as
txt, they preserve the horizontal separator of the table. - Added imports on
stringiandcheckmateas they are fundamental packages for string handling and argument checking. - Updated introduction vignette and split it into two. Section on introspecting tables is now located in a separate vignette.
rtables 0.6.5
New Features
- Added support for white spaces in all labels and text by redesigning of wrapping functions in
formatters. - Added support for new line characters across rtables (titles, column names, row names, footers, and
na_str). - Modified top left information vertical alignment to stay at the bottom of the header.
rtables 0.6.4
New Features
- Added support for
.docxexports withexport_as_docx(). - Expanded support for
flextablecustomization with theme function specific for word documents (theme_docx_default()).
rtables 0.6.3
CRAN release: 2023-08-30
New Features
- Analysis functions (
cfun/afun) can use new parameters to extend analysis calculations:.alt_df_rowand.alt_dfgive access toalt_counts_dfacross columns, while.all_col_exprsand.all_col_countscontains global information about all columns. - Binding objects via
rbindwill retain titles/footer information if identical in all objects or only present in the first object being bound.
Enhancements
- Analysis functions (
cfun/afun) have more information about current column split;.spl_contexthas access tocur_col_id,cur_col_expr,cur_col_split, andcur_col_split_val. - Added vignette on exploratory analysis with
qtable. - Extracted
qtable_layoutfromqtable.
Bug Fixes
- Page-by splits which generate zero facets (and thus tables which would have zero pages when rendered) now throw an informative error at table build time.
- Removed superfluous warning which arose for custom split functions when reference group is is set (https://github.com/insightsengineering/rtables/issues/707#issuecomment-1678810598).
- Fixed
qtablelabeling viarow_labels(#698). - Error catching and test coverage for cases where
alt_counts_dfpresents different splits fromdf.
Miscellaneous
- Cleaned up spelling in documentation (#685)
- Custom appearance vignette updated with decimal alignment support.
- Alignment checks have been moved into
formatters:formatters::check_alignssuperseded internal functionchk_rtables_alignandformatters::list_valid_alignssupersededrtables_aligns.
rtables 0.6.2
- Fixed major regressions for
page_bymachinery caused by migration toformatters0.5.1 pagination framework. - Fixed
page_bylabels become missing when only one level exist in thesplit_rows_by. - Fixed a bug when dropping
varlevels but notlblvarlevels. - Added checks to catch bad labels (with {}) and throw informative error.
- Added
qtablefunction to create a table with a single top-level structure in both row and column dimensions involving faceting by 0 or more variables in each. - Added
as_result_dffunction to flatten a table into a dataframe. - Added
sanitize_table_struct,validate_table_struct,find_degen_structto support degenerative table rendering.
rtables 0.6.1
CRAN release: 2023-05-25
- Improved resilience of pagination machinery (
paginate_table) by generalizing parameters’ defaults (cpp,lpp, andfont_size). - Moved
export_as_txttoformatters. Added to reexports. - Migrated
export_as_rtftoformatters. Not re-exported. - add
r2rtfto Suggests - pagination logic has been migrated completely (excepting page_by splits) to
formattersand is now invoked from there. paginate_table remains as a convenience function. - Removed warning in
strmethod when called upon table objects. - Provide
strmethod forVTableTreeobjects with a defaultmax.levelof 3, as the infinite default from base is not useful or informative. - default
font_sizevalue is now8across pagination and export machinery -
marginsargument in pagination and export machinery now (correctly) interpreted as inches. This change is inherited fromformatters -
lppandcppnow default toNA_integer_, which is interpreted as inferring their value from the physical page size specified. - Horizontal pagination now occurs by default due to the above (because there is a default page type -
"letter". Pagination can still be turned off in either direction by settingl/cpptoNULLexplicitly. - Referential footnotes now have both a
symboland anindex. Messages associated with symbols will only appear once per page in the footer materials regardless of number of elements referenced in the page with that symbol. Matches and inherits from changes informatters - Started deprecation cycle for
trim_zero_rows. - Fixed bug occurring when extracting
cell_valuesafter sorting. - Removed deprecated function
vpaginate_table. - Added examples and details for
sort_at_path. - Added
split_labelto functionsplit_rows_by_multivarandextra_argsto functionsplit_cols_by_multivar. - Added
split_rows_by_multivardocumentation.
rtables 0.6.0
CRAN release: 2023-03-02
- added
make_split_funfunction for creation of custom split functions -
basic_tablenow acceptscolcount_format - 2d formats are now allowed for column counts provided one element is a percent, which will be automatically set to 100%
-
spl_contextnow includes root row in row-split contexts. - Added vignette on format precedence
- Added vignette on split functions
- Added custom appearance vignette
- Significant overhaul of sorting vignette
- extended and clarified documentation
-
export_as_pdfnow correctly takesmarginsinto account when calculatinglppandcppfrom page size. - exporters now pass down non-default
colwidthsvalues correctly -
nlinesTableRowmethod (used for both rows and column label extent in pagination) now correctly handles column spanning - pagination with
verbose = TRUEnow includes original and adjusted lines-per page information -
cont_n_allcolsandcont_n_onecolscore functions now throw errors when they are applied to subtables that have no content table, instead of the previously returnedNA -
sort_at_pathnow emits an informative error message when score functions fail. -
paginate_tablenow acceptscolwidthsand paginates assuming column label and cell values are wrapped to those widths. -
make_row_dfnow acceptscolwidthsand calculates row extents assuming cell values are wrapped to those widths -
nlinesTableRowmethod now uses providedcolwidthsto assume cell-value wrapping -
export_to_txtnow automatically paginates when any form of page dimension is provided (previously the default was unconditionally not paginating). - Versioned dependency on
formattersincreased to>=0.4.0
rtables 0.5.3
-
[<-now treats characteriandjvalues as paths, the same as[always has. -
[<-CellValuemethod now preservesCellValueattributes (e.g., format) - More detailed subsetting and modification vignette
-
nlinesmethods now accept bothcolwidthsandmax_width -
max_widthis now used during pagination to determine lines taken up by referential footnotes -
make_col_dfnow acceptscolwidthsargument, and can be called directly onInstantiatedColumnInfoobjects - versioned dependency on
formattersincrease to>0.3.3.12 - word wrapping title/footer materials no longer fails in the presence of
""values. - versioned dependency on
formattersincrease to>0.3.3.11 -
paginate_tablenow acceptstf_wrapandmax_widthand respects title/footer word wrapping when present - export functions now accepts
tf_wrapandmax_widthand use them in both pagination (when turned on) andtoStringwhen used (pdf, txt exporters). - versioned dependency on
formattersincreased to>0.3.3.10 -
export_as_pdfnow accepts standard page/font size parameters - original parameters (
width,height,fontsizeare soft deprecated (no warning) and will be fully deprecated and then removed in the future. -
toStringmethod forVTableTreenow acceptstf_wrapandmax_width -
export_as_txtandexport_as_pdfnow acceptcpp, as well astf_wrapandmax_widthand default totf_wrapbeing on andmax_width = cppwhencppis non-NULL. -
basic_tablenow acceptsinsetargument for declaring table inset - Table and Layout object classes now have a
table_insetslot, with accessor functions. -
matrix_formmethod forVTableTreesetstable_insetvalue - Increase versioned dependency on
formattersto>0.3.3.5fortable_insetsupport - Use
exact=TRUEin all calls toattrwithin access functions - Increase versioned dependency on
formattersto>0.3.3.4 - layouting instructions now accept
na_strargument, which specifiesnastring with the same inheritance rules as formats - (pre-data) Split and (post tabulation) Table/row S4 classes now carry around
na_strinformation - Increase versioned dependency on
formattersto>= 0.3.3.3for support ofna_strs withNA_character_values -
paginate_tablenow takes page dimension and font information and usesformatters::page_lcppto calculatelppandcppautomatically when those are provided. - Increase versioned dependency on
formattersto>= 0.3.3.2forpage_lcpp
rtables 0.5.2
-
paginate_tablenow acceptscppand will perform vertical pagination when it is non-null -
vpaginate_tableis now deprecated - Increased versioned dependency on
formattersto>=0.3.2.4
rtables 0.5.1.5
- Support for section dividers (
section_divargument insplit_rows_by*function) - Updated versioned dependency on
formattersto>=0.3.2.3 - Equivalent split functions with different enclosing environments (e.g., 2 identical calls to
add_combo_levels#340) no longer blockrbinding - Fixed various documentation bugs where description section was being added to header.
rtables 0.5.1.3
- Throw informative error messages when custom analysis, content or split functions fail (#329)
rtables 0.5.1.2
- empty level check for splitting variables temporarily removed. It is very likely to be reinstated in a future release.
rtables 0.5.1.1
-
col_countsgetter and setter now acceptpathargument. - empty levels of a splitting variable now result in an informative error message (character and factor cases).
- fixed bug in handling of column extra arguments that was preventing
cbinding tables from working correctly ([#324]](https://github.com/insightsengineering/rtables/issues/324))
rtables 0.5.1
CRAN release: 2022-05-21
- empty factor levels are now not dropped for column splits when ref_group is set (#323)
-
linesepargument totoStringand related functions renamed tohsep - Increase versioned dependency on
formattersto>=0.3.0 - Default “line separator” between header and body now falls back to “-” non-UTF charset locales.
- New
hsepargument tobuild_tablewhich sets the horizontal separator for the constructed table (and subtables thereof) - New
horizontal_sepandhorizontal_sep<-accessors for constructed tables, the latter of which is mandatorily recursive. -
split_rows_by(var, child_labels="hidden")no longer removes the structural subtable corresponding to levels ofvar(#314)
rtables 0.5.0
CRAN release: 2022-04-01
-
formatabledependency renamed toformattersfor suitability of release to CRAN - Update versioned dependency of
formatters(previouslyformatable) to>=0.2.0
rtables 0.4.1.0001
- added
linesepargument totoStringto specify a character to create the line separator. Previously we used the en dash as the line separator character, now we changed the default to the em dash reducing the gap between the dash line elements.
rtables 0.4.0
CRAN release: 2021-10-06
- Initializing layouts with
NULLis now deprecated -
insert_rrowis deprecated in favor of newinsert_row_at_pathandlabel_at_path<-functions - split and analysis/content functions can now depend on values of splits they are nested inside by accepting and using the new
.spl_contextoptional argument - new
trim_levels_to_mapsplit function for dictating exact combinations of values which should appear across splits -
value_formatsfunction now exported which returns/displays the effective formats of all cells in a table -
compare_rtablesis now much faster for tables with many cells -
compare_rtablesnow acceptsstructureargument which adds comparison of structure (by way of row- and column-path positions) - new
tt_to_flextablecoercion function - new
export_as_pdfexporter function -
value_atandcell_valuesfunctions now have methods forTableRowobjects making them usable in sorting/pruning functions
rtables 0.3.8.9001
- new
trim_levels_to_mapsplit function based on[@wwojciech](https://github.com/wwojciech)’s work in #203 - support for column referential footnotes
- support for adding footnotes to existing table via
fnotes_at_path<-function -
trim_levels_in_groupnow trims empty levels of outer (split) variable by default -
value_atandcell_valuesnow work fortablerowobjects - Fixed
as_htmlbug inmultivarsplit columns case - Fixed pagination off-by-one error
rtables 0.3.8
CRAN release: 2021-07-13
- Add experimental support for newlines in column names, row labels, and cell values (not supported in top-left annotations)
-
as_htmlrefactored to support newlines while respecting table structure - self_extent column of
dfreturned bymake_row_dfnow reflects extent in lines, thus will return larger values if the row-label or any cell values contain newlines. - Fix bug where tables output using
as_html(or viewed inViewer) were missing the table class attribute (#194) - inserting a
DataRowwith incorrect number of columns is now an error (#199) - Referential footer machinery now works in
colspancase. - Fix extraneous footnote attribute bug (#198)
- Fix max -Inf warning when content rows appear at positions whose children have 0 visible rows (#200)
- Resync
NEWS.mdfile - Introduce titles and footnotes
- Support automatic population of top-left
- Introduce referential footnote support for cells and row labels
- Added
vars_in_layoutto list (explicitly named only) variables used in a layout - Fix column label ordering bug when value label variable is a factor (#173)
rtables 0.3.6
CRAN release: 2021-01-22
Documentation revisions as requested by CRAN. No change to package code.
rtables 0.3.5
Documentation-text only changes to introduction vignette to pass CRAN’s URL checks. All package, example, test, and vignette code fully identical to that in tagged GitHub release 0.3.4
rtables 0.3.3
This version completely refactors the rtables package. We do provide a backwards compatibility layer with the rtable, rcell, rrow, rheader, and rtabulate family of functions. However the table data structure and main tabulation framework have changed. We provide extensive documentation in the manuals help(package = "rtables") and vignettes vignette(package = "rtables") of the package.
The changes to rtables have been undertaken to better meet the requirements of creating and analyzing & reporting tables in the context of clinical trials.
rtables 0.3.2.17.9046
-
make_afunnowforce()s all customization arguments immediately, which prevents problems when called within loop/lapplyconstructs.
rtables 0.3.2.17.9045
- Tabulation machinery no longer removes NAs mandatorily in some cases, including
multivarcolumn splits -
analyze_colvars’sinclNAsargument now respected.
rtables 0.3.2.17.9044
- Fix indent modifier propagation during tabulation
- Fix indent calculation in
make_pagdf - Add significant testing to ensure
make_pagdfindent calculation remains correct
rtables 0.3.2.17.9043
- Rework how reference columns are handled so analyses which use
.in_ref_coland.ref_groupwork correctly when custom splitting is used (including the provided combination-levels mechanism)
rtables 0.3.2.17.9042
- Fix naming/pathing for columns in
multivarcase (split itself now has default name"multivars") - Fix labeling bug when same variable appears multiple times in
MultiVarSplitwith different associated levels
rtables 0.3.2.17.9041
- Allow single variable to be used within
split_cols_by_multivar - Various removal of defunct
rtables 0.3.2.17.9040
- Fix regression caused by 0.3.2.17.9039 where column split values were displayed by name rather than label.
rtables 0.3.2.17.9039
- Fix bug in display of column information when column structure is not symmetric, as with recursive
cbinds.
rtables 0.3.2.17.9036
- Fixed bug in row subsetting when table has only content rows.
- Basic compare_rtables function now works as in previous versions, no awareness of row or column structure.
rtables 0.3.2.17.9036
-
summarize_row_groupscan now accept a list of functions for thecfunargument asanalyze_colvarsdoes.
rtables 0.3.2.17.9035
- Fix bug unearthed by change in 0.3.2.17.9034 where cell formats not retained during column subsetting
rtables 0.3.2.17.9034
- Fix internal
value_formatsaccessor so it operates onCellValues rather than the raw contained values (thus always returning NULL) -
rrowconstructor no longer interprets cell formats a row format when they are the same across all cells. Fixes bug in “correct way” code discussed in #112
rtables 0.3.2.17.9029
- Fix issue underlying spurious length-mismatch warning in some cases when using
analyze_colvars
rtables 0.1.3
-
col_byinrtabulatenow accepts matrices:-
col_by_to_matrix,col_by_to_factor,by_factor_to_matrix. -
by_add_total,by_all,by_combine,by_quartile,by_compare_subset,by_hierarchical,by_drop_empty_cols.
-
- New utility functions to deal with variable labels:
-
label,var_labels<-,var_labels,var_labels_remove,var_relabel,with_label.
-
- Other new functions:
-
cbing_rtables. -
empty_rtables,is_empty_rtable,is_non_empty_rtable,is_rtable. -
header_indent,header_indent<-,header_row.names,header_row.names<-. -
insert_rrow.
-
rtables 0.1.2
-
rbind.rtablenow supports binding rtables with rows, e.g.rbind(tbl1, rrow(), tbl2)orrbind(tbl1, rrow("row name"), tbl2). -
rbindl_rtablessupportsNULLobjects in the list (except for the first element). - Add
indentfunction. -
header_add_Ndeals gracefully withNULLobjects.
rtables 0.1.1
-
rtablulatefamily of functions do not support therow_*_data_argsarguments anymore. Instead, thecol_wise_argsargument is introduced. - Functions
order_rrows,sort_rrows,order_rtables, andsort_rtablesare introduced. - Prevent
rtablesfrom being unlisted withunlist.rtables.
rtables 0.1.0.6
-
Viewernow also accepts objects of classshiny.tag(defined in packagehtmltools). -
as.htmlacceptsclass.table,class.tr,class.th, andclass.tdas an argument.
rtables 0.1.0.5
- Added
sprintf_formatfor formattingrcells (thanks to Doug Kelkhoff for the suggestion). - Added
"(N=xx)"and">999.9"format labels. -
rtabulatehas now an argumentcol_Nand the functioncol_N().
rtables 0.1.0
- Version
0.1.0is a major re-design with lots of internal refactoring and the following API changes:- Redesign:
rtablehas nowheaderargument instead ofcol.names. Aheadercan be created withrheaderand is a collection ofrrows. Ifheaderis set toc("A", "B")thenrtablewill create therheaderwith a singlerrowand by settingrow.nametoNULL. -
headerandheader<-function added. - Renamed
get_rcell_formatstolist_rcell_format_labels. - If
rcellformat isNULLthen the cell content will be converted to a string withpaste(as.character(x), collapse = ', '). - Accessor
[i,]works now to subset a table. -
rbindmethod for rtables. -
row.names<-.rtablemethod. -
rtabulateadded for creating tables. -
indented_row.namesfunction added.
- Redesign:
