round_type instead ofneeding to specify on export #1040obj_round_type getter and setter methods.pkgdown siteparent_name argument tosplit_rows_by* andanalyze* functions tomanually control names of (and thus paths to) the subtables created.#1024 bytt_row_path_exists, which determines whether apath exists within a table’s row structure, optionally restricted toresolving to a particular type of node (row, table, elementary table).#1024 bytt_normalize_row_path which resolves a pathincluding the “*” wild card to all existing paths within a table,optionally restricted to resolving to a particular type. #1024 by?pathing) to the man page for the above functions.pathing vignette.make_row_df is called on aVTableTreethe returned df now includes newsect_div_from_path andself_section_div columns. #1024 bysection_div_info convenience function whichreturns portions ofmake_row_df’s result relevant tosection dividers. #1024 bysection_div_at_path andsection_div_at_path<- for getting and setting sectiondividers for substructures within the table. The latter supports “*”wildcards for flexible usage. #1024 by?section_div)updated and expanded. #1024 byas_result_df to “de-uniqify” names that werealtered for pathability when determining group values in the resultdataframe/ard. #1024 bysection_div<- withonly_sep_sections = TRUE more values than levels of nestingpresent is now more informative, and occurs regardless of whetheronly_sep_sections was set manually or automatically(length(value) < nrow(tt)). #1024 bysection_div<- now works correctly on tables thatinclude top level siblings in their row structure (e.g., when unnestedstructure is added vianested = FALSE or adding a rowsplitting after ananalyze call). #1024 bysection_div<- withonly_sep_sections = FALSE is now consistent regarding whichvalue is set whenanalyze calls occur at different levelsof nesting within the corresponding layout, particularly as top-levelnon-nested siblings. #1024 bysection_div<- no longer sets a section div onnon-visible label rows when setting a section divider for a content rowon the same group. #1024 bysection_div<- when given a full-length(nrow(tt)) vector now sets ‘section dividers’ on label rowsand content rows correctly when both are visible for the same facet.#1024 by[ methods with signatures involvingcharacter andmissing.[ methods togracefully handle new sibling name de-duplication scheme.subset_cols generic and methods are now exported.has_force_pag generic and methods are nowexported.stat_string toas_result_df(make_ard = TRUE) to preserve the originalstring representation of the statistics.add_tbl_name_split toas_result_df()to handle split levels constituted by different table names..alt_df_full which will always be the fullalt_counts_df data.frame.sort_at_path orprune_table, score functions can also acceptdecreasing to receive sort order.split_cols_by_multivar() when havingmore than one value. Nowas_result_df(make_ard = TRUE) addsa predefined split name for each of themultivarsplits.tt_at_path() caused by theimpossibility to solve multiple branches with identical names.as_result_df(make_ard = TRUE) usesthe cell values forstat_strings for these exceptions.section_div argument toanalyze no longersometimes applies dividers between each generated row in some cases. by@gmbecker[<- causing information to be strippedfrom other cells if a newrcell is set within a tablerow.as_result_df(make_ard = TRUE) whendifferent columns had different amounts of"" values.stat_name ischaracter(0)(as_result_df(make_ard = TRUE)).integer(), i.e. producing an empty table.add_tbl_str_decimals = TRUE to... intoas_result_df(make_ard = TRUE) to addstat_string column for theARD output.stat_string are more fragile than defaultas_result_df(make_ard = TRUE) calculation and are in theoryoptional, a warning is thrown when errors arise and thestat_string column is not added.tt_at_pathused a path based on row labels instead of row names.keep_split_levels() is used to keep absent values.[.keep_split_levels() whenbranch is empty(character(0)).as_result_df().make_ard output for single-linestatistical outputs.stat_names torcell() to be used byas_result_df(make_ard = TRUE).docx document generation to the new packagertables.officer.as_result_df() parametersas_strings andas_viewer intodata_format = c("full_precision", "strings", "numeric")following the same outputs.as_result_df() to have a standard behavior,with all the relevant parameters, and a possibility to add personalizedspec.result_df_specs(), becauseas_result_df() was a too shallow wrapper.as_result_df() parametersas_is andsimplify parameters to removestructural information.flextable from aTableTree object.analyze that was causing an error whenpassing a singleNA value to thevar_labelsparameter.analyze calls inas_result_df.section_properties_default() function to definestandard portrait properties for tables..html outputs.bold_titles tott_to_flextable() to bold titles.tt_to_flextable(), and/or extend themes.reorder_split_levels() to cover more edgecases and be more stringent in the allowed inputs.tt input fromtheme_docx_default() and added code to handle row classesand number of columns internally.theme_docx_default().bold_titles tott_to_flextable() to bold titles."\n" newline issues inas_html byrelying onto output devices for newline handling. Addedexpand_newlines = FALSE default to allow previousbehavior.keep_split_levels() throws now an error if the userrequests to keep levels that are not present in data.tt_as_flextable() header when title was added.flextable."" having larger imposedmargins than filled cell. They are transformed into" "before rendering.theme_docx_default() when only one line of column names ispresent, but top left information is on multiple lines.sep = "\t" and set otherparameters via... parameter propagation inexport_as_tsv.matrix_form andtoString.simple_analysis into utils file.theme_docx_default() showing how toextend the default theme.theme_html_default().col_counts vignette wording, as CRANmacOS check failed. Raised the issue with the R-core teamalready.truetype fonts based onformatters version>= 0.5.8. Nearly allfunctions related to pagination or export now acceptfontspec argument and pass it around accordingly, bymake_split_fun provided thatcore_splitassociates the generated facets with subsetting expressions. Subsettingexpressions remain unnecessary for splits in row space. Bymake_split_res,add_to_split_result nowaccept a list of subsetting expressions which will be attached to thevalues, byvalue_expr internal getter and setter methods, by@gmbecker.split_cols_by* functions now acceptshow_colcounts andcolcount_formatarguments.colcount_visible getter andsetter for changing column count visibility in an already built table@gmbecker.facet_colcount getter andsetter column count value at arbitrary point in column structure ofbuilt tablefacet_colcounts_visible setter to conveniently setthe column count visibility of a set of sibling facets in columnspacerm_all_colcounts convenience function for turningoff visibility all column counts throughout the column structureas_html preventing indentation from beingapplied inViewer output.col_counts<- andcol_total<- methodsnow explicitly convertvalue to integer, bycol_gap is now respected innlines rowmethods, and thus bymake_row_df, bylifecycle badge files for deprecateddocumentation.gap andcheck_headersarguments torbindl_rtables usinglifecycle.top_level_section_div forbasic_table to set section dividers for top levelrows.keep_label_rows toas_result_df tohave these lines visible.sort_at_path now gives informative error messages whenthe given path does not exist.rlistings decoration (e.g. titles and footers)expansion when there are new lines. Moved relevant handling fromrtables’matrix_form function toformatters’ dedicatedmform_handle_newlinesfunction.rtables_root not being removed whenusingas_result_df.as_result_df where rows of thetable have only"root" as path index.sort_at_path pathing to ignore leading"root" element (regardless of actual root element name) tomatch currenttt_at_path behavior.section_div for analysis of multiple variables(AnalyzeMultiVars).mf_rinfo(mf)) and actual selected indentation frommatrix_form(mf, indent_rownames = FALSE).as_html preventing indentation from beingapplied inViewer output.col_counts<- andcol_total<- methodsnow explicitly convertvalue to integer, bycol_gap is now respected innlines rowmethods, and thus bymake_row_df, byas_html to accommodate\ncharacters.add_analyzed_var andtrim_zero_rows.ref_group reordering in column splits so not tochange the order.bold argument toas_html to boldspecified elements, andheader_sep_line argument to print ahorizontal line under the table header in rendered HTML output.section_div andsection_div<-). They alsoaccept split section structure assignment.header_section_div setters and getters for layoutand table objects along with relatedbasic_tableparameter.na_str argument toanalyze_colvarsto set custom string to print in place of missing values.data.frame outputs foras_result_df() via flag parametersas_viewer,as_strings, andexpand_colnames.export_as_pdf function toformatters.as_result_df causing misalignment ofcolumn names.row_paths() was giving a different path due to it beingmade of named values.as_result_df when called on tables withless than 3 rows.styler and resolved package lint. Changeddefault indentation from 4 spaces to 2.as_html.col_fnotes_here to bereplaced withcol_footnotes.section_div methods now have a dedicateddocumentation page that is visible to users.txt, they preserve thehorizontal separator of the table.stringi andcheckmate asthey are fundamental packages for string handling and argumentchecking.formatters.na_str).Viewer andas_html tofail when new line characters were added..docx exports withexport_as_docx().flextable customization with themefunction specific for word documents(theme_docx_default()).NA rows to be included in every.df_row split.cfun/afun) can use new parametersto extend analysis calculations:.alt_df_row and.alt_df give access toalt_counts_df acrosscolumns, while.all_col_exprs and.all_col_counts contains global information about allcolumns.rbind will retain titles/footerinformation if identical in all objects or only present in the firstobject being bound.cfun/afun) have more informationabout current column split;.spl_context has access tocur_col_id,cur_col_expr,cur_col_split, andcur_col_split_val.qtable.qtable_layout fromqtable.qtable labeling viarow_labels (#698).alt_counts_df presents different splits fromdf.formatters:formatters::check_aligns superseded internal functionchk_rtables_align andformatters::list_valid_aligns supersededrtables_aligns.page_by machinery caused bymigration toformatters 0.5.1 pagination framework.page_by labels become missing when only one levelexist in thesplit_rows_by.var levels but notlblvar levels.qtable function to create a table with a singletop-level structure in both row and column dimensions involving facetingby 0 or more variables in each.as_result_df function to flatten a table into adataframe.sanitize_table_struct,validate_table_struct,find_degen_struct tosupport degenerative table rendering.paginate_table) by generalizing parameters’ defaults(cpp,lpp, andfont_size).export_as_txt toformatters. Addedto reexports.export_as_rtf toformatters. Notre-exported.r2rtf to Suggestsformatters and is now invoked from there.paginate_table remains as a convenience function.str method when called upon tableobjects.str method forVTableTree objectswith a defaultmax.level of 3, as the infinite default frombase is not useful or informative.font_size value is now8 acrosspagination and export machinerymargins argument in pagination and export machinery now(correctly) interpreted as inches. This change is inherited fromformatterslpp andcpp now default toNA_integer_, which is interpreted as inferring their valuefrom the physical page size specified."letter".Pagination can still be turned off in either direction by settingl/cpp toNULL explicitly.symbol and anindex. Messages associated with symbols will only appearonce per page in the footer materials regardless of number of elementsreferenced in the page with that symbol. Matches and inherits fromchanges informatterstrim_zero_rows.cell_values aftersorting.vpaginate_table.sort_at_path.split_label to functionsplit_rows_by_multivar andextra_args tofunctionsplit_cols_by_multivar.split_rows_by_multivar documentation.make_split_fun function for creation of customsplit functionsbasic_table now acceptscolcount_formatspl_context now includes root row in row-splitcontexts.export_as_pdf now correctly takesmarginsinto account when calculatinglpp andcpp frompage size.colwidths valuescorrectlynlinesTableRow method (used for both rowsand column label extent in pagination) now correctly handles columnspanningverbose = TRUE now includes originaland adjusted lines-per page informationcont_n_allcols andcont_n_onecol scorefunctions now throw errors when they are applied to subtables that haveno content table, instead of the previously returnedNAsort_at_path now emits an informative error messagewhen score functions fail.paginate_table now acceptscolwidths andpaginates assuming column label and cell values are wrapped to thosewidths.make_row_df now acceptscolwidths andcalculates row extents assuming cell values are wrapped to thosewidthsnlinesTableRow method now uses providedcolwidths to assume cell-value wrappingexport_to_txt now automatically paginates when any formof page dimension is provided (previously the default wasunconditionally not paginating).formatters increased to>=0.4.0[<- now treats characteri andj values as paths, the same as[ alwayshas.[<-CellValue method now preservesCellValue attributes (e.g., format)nlines methods now accept bothcolwidthsandmax_widthmax_width is now used during pagination to determinelines taken up by referential footnotesmake_col_df now acceptscolwidthsargument, and can be called directly onInstantiatedColumnInfo objectsformatters increase to>0.3.3.12"" values.formatters increase to>0.3.3.11paginate_table now acceptstf_wrap andmax_width and respects title/footer word wrapping whenpresenttf_wrap andmax_width and use them in both pagination (when turned on)andtoString when used (pdf, txt exporters).formatters increased to>0.3.3.10export_as_pdf now accepts standard page/font sizeparameterswidth,height,fontsize are soft deprecated (no warning) and will be fullydeprecated and then removed in the future.toString method forVTableTree now acceptstf_wrap andmax_widthexport_as_txt andexport_as_pdf now acceptcpp, as well astf_wrap andmax_width and default totf_wrap being on andmax_width = cpp whencpp is non-NULL.basic_table now acceptsinset argument fordeclaring table insettable_insetslot, with accessor functions.matrix_form method forVTableTree setstable_inset valueformatters to>0.3.3.5 fortable_inset supportexact=TRUE in all calls toattr withinaccess functionsformatters to>0.3.3.4na_str argument,which specifiesna string with the same inheritance rulesas formatsna_str informationformatters to>= 0.3.3.3 for support ofna_strs withNA_character_ valuespaginate_table now takes page dimension and fontinformation and usesformatters::page_lcpp to calculatelpp andcpp automatically when those areprovided.formatters to>= 0.3.3.2 forpage_lcpppaginate_table now acceptscpp and willperform vertical pagination when it is non-nullvpaginate_table is now deprecatedformatters to>=0.3.2.4section_div argument insplit_rows_by* function)formatters to>=0.3.2.3add_combo_levels#340)no longer blockrbindingcol_counts getter and setter now acceptpath argument.cbinding tables from working correctly([#324]](https://github.com/insightsengineering/rtables/issues/324))linesep argument totoString and relatedfunctions renamed tohsepformatters to>=0.3.0hsep argument tobuild_table whichsets the horizontal separator for the constructed table (and subtablesthereof)horizontal_sep andhorizontal_sep<-accessors for constructed tables, the latter of which is mandatorilyrecursive.split_rows_by(var, child_labels="hidden") no longerremoves the structural subtable corresponding to levels ofvar (#314)formatable dependency renamed toformatters for suitability of release to CRANformatters (previouslyformatable) to>=0.2.0cfuncaused error (#307)path_enriched_df (which powerstsv export), related to (#308)table_shell to display shell of table withformatslinesep argument totoString tospecify a character to create the line separator. Previously we used theen dash as the line separator character, now we changed the default tothe em dash reducing the gap between the dash line elements.NULL is now deprecatedinsert_rrow is deprecated in favor of newinsert_row_at_path andlabel_at_path<-functions.spl_context optional argumenttrim_levels_to_map split function for dictatingexact combinations of values which should appear across splitsvalue_formats function now exported whichreturns/displays the effective formats of all cells in a tablecompare_rtables is nowmuch faster for tableswith many cellscompare_rtables now acceptsstructureargument which adds comparison of structure (by way of row- andcolumn-path positions)tt_to_flextable coercion functionexport_as_pdf exporter functionvalue_at andcell_values functions nowhave methods forTableRow objects making them usable insorting/pruning functionstrim_levels_to_map split function based on[@wwojciech](https://github.com/wwojciech)’s work in#203fnotes_at_path<- functiontrim_levels_in_group now trims empty levels of outer(split) variable by defaultvalue_at andcell_values now work fortablerow objectsas_html bug inmultivar splitcolumns caseas_html refactored to support newlines while respectingtable structuredf returned bymake_row_df now reflects extentin lines, thuswill return larger values if the row-label or any cell values containnewlines.as_html (or viewed inViewer) were missing the table class attribute (#194)DataRow with incorrect number of columns isnow an error (#199)colspancase.NEWS.md filevars_in_layout to list (explicitly named only)variables used in a layoutSynchronize release with GitHub commitsha.
Documentation revisions as requested by CRAN. No change to packagecode.
Documentation-text only changes to introduction vignette to passCRAN’s URL checks. All package, example, test, and vignette code fullyidentical to that in tagged GitHub release 0.3.4
Minor changes to the 0.3.3 version in order to submitrtables to CRAN.
This version completely refactors thertables package.We do provide a backwards compatibility layer with thertable,rcell,rrow,rheader, andrtabulate family of functions.However the table data structure and main tabulation framework havechanged. We provide extensive documentation in the manualshelp(package = "rtables") and vignettesvignette(package = "rtables") of the package.
The changes tortables have been undertaken to bettermeet the requirements of creating and analyzing & reporting tablesin the context of clinical trials.
make_afun nowforce()s all customizationarguments immediately, which prevents problems when called withinloop/lapply constructs.multivar column splitsanalyze_colvars’sinclNAs argument nowrespected.make_pagdfmake_pagdf indentcalculation remains correct.in_ref_col and.ref_group work correctly whencustom splitting is used (including the provided combination-levelsmechanism)multivar case (splititself now has default name"multivars")MultiVarSplit with different associated levelssplit_cols_by_multivarcbinds.summarize_row_groups can now accept a list of functionsfor thecfun argument asanalyze_colvarsdoes.value_formats accessor so it operates onCellValues rather than the raw contained values (thusalways returning NULL)rrow constructor no longer interprets cell formats arow format when they are the same across all cells. Fixes bug in“correct way” code discussed in#112in_rows ascell formatsrather than row formats.cbind_rtables can now take more than 2 tables.analyze_colvarsanalyze_colvars now takes and adheres toinclNAs argumentxx.xx (xx.xx - xx.xx) andx.xxxx | (<0.0001)col_by inrtabulate now 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.label,var_labels<-,var_labels,var_labels_remove,var_relabel,with_label.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.rbind.rtable now supports binding rtables with rows,e.g. rbind(tbl1, rrow(), tbl2) orrbind(tbl1, rrow("row name"), tbl2).rbindl_rtables supportsNULL objects inthe list (except for the first element).indent function.header_add_N deals gracefully withNULLobjects.rtablulate family of functions do not support therow_*_data_args arguments anymore. Instead, thecol_wise_args argument is introduced.order_rrows,sort_rrows,order_rtables, andsort_rtables areintroduced.rtables from being unlisted withunlist.rtables.Viewer now also accepts objects of classshiny.tag (defined in packagehtmltools).as.html acceptsclass.table,class.tr,class.th, andclass.tdas an argument.sprintf_format for formattingrcells(thanks to Doug Kelkhoff for the suggestion)."(N=xx)" and">999.9" formatlabels.rtabulate has now an argumentcol_N andthe functioncol_N().0.1.0 is a major re-design with lots ofinternal refactoring and the following API changes:rtable has nowheader argumentinstead ofcol.names. Aheader can be createdwithrheader and is a collection ofrrows. Ifheader is set toc("A", "B") thenrtable will create therheader with a singlerrow and by settingrow.name toNULL.header andheader<- functionadded.get_rcell_formats tolist_rcell_format_labels.rcell format isNULL then the cellcontent will be converted to a string withpaste(as.character(x), collapse = ', ').[i,] works now to subset a table.rbind method for rtables.row.names<-.rtable method.rtabulate added for creating tables.indented_row.names function added.