Changelog
Source:NEWS.md
ltsummary 0.9.0
-
add_difference()gains the"cohens_d","hedges_g","paired_cohens_d"and"paired_hedges_g"methods, the standardized mean differences gtsummary computes with effectsize, here in base R: the difference in means over the pooled standard deviation (or over the root mean of the two variances, with Welch’s degrees of freedom, whentest.argspassespooled_sd = FALSE), the mean of the pair differences over their standard deviation for the paired forms, the noncentral t interval, and the exact small-sample correction for Hedges’ g.test.argsalso acceptsmuandalternative; a name effectsize would ignore is an error here. The interval solves the noncentral t equations exactly where effectsize approximates them withoptim(), so the limits agree to within 1e-6 and the formatted cells match. effectsize joins Suggests as the test oracle, as car does foradd_vif().
ltsummary 0.8.0
- The mirrored interface moves from gtsummary 2.5.1 to gtsummary 2.6.1, the CRAN release of 2026-09-04 (decisions/0021). The 2.6 releases change no table defaults and deprecate nothing; their additions are adopted below. lt 0.4 is supported as is: its new em dash for missing cells never shows because
as_lt()blanks every missing cell before rendering, and spanning headers remain a single row. -
theme_ltsummary_language()gains Bosnian ("ba"), and the embedded translation table is gtsummary 2.6.1’s: the French strings were revised there, so the p-value header reads “Valeur p” and the Welch and Student t-tests are named apart. -
modify_abbreviation()follows the released form of gtsummary 2.6.0:prefixis two strings, singular and plural (c("Key", "Keys");c("", "")drops the leading text and its separator),prefix,sep1andsep2default to the new theme elements"modify_abbreviation-arg:prefix","modify_abbreviation-arg:sep1"and"modify_abbreviation-arg:sep2", only the default prefix is translated, and the values persist across calls. A single-stringprefix, accepted since 0.2.0, is an error now. -
add_difference()gainslevels, the twobylevels to compare in the orderlevels[1]minuslevels[2]: required whenbyhas more than two levels, and a way to flip the direction when it has two. The table keeps every group’s column, and a header footnote names the pair, as in gtsummary 2.6.0. -
sort_hierarchical()gainsby_level, one level of thebyvariable whose counts alone rank the rows of a"descending"sort, as in gtsummary 2.6.0. -
add_difference()gains a method fortbl_hierarchical()tables: a “Rate Difference” column with the difference between the event rates of twobylevels on every row, chosen and ordered withlevels, shown through thestatisticpattern and formatted byestimate_fun, with a footnote naming the pair, as in gtsummary 2.6.0. gtsummary computes it on its cards ARD; ltsummary subtracts the stored rates, so sorted and filtered tables work too. See?add_difference_hierarchical. -
without_ltsummary_theme()evaluates an expression with no theme active, the package defaults, and then restores the theme, the counterpart of gtsummary 2.6.0’swithout_gtsummary_theme(). -
add_significance_stars()adds stars for small p-values next to the estimates of a regression table, or the p-values of any other table, with thepattern,thresholds,hide_ci,hide_pandhide_searguments.theme_ltsummary_journal("qjecon")now applies it to regression tables, with the standard error under the estimate, so the journal theme is complete. -
add_vif()adds the variance inflation factors of a regression model, or the generalized factors with their degrees of freedom and the adjusted form when a term has several coefficients, with thestatisticandestimate_funarguments. The factors are computed in base R from the coefficient covariance, ascar::vif()does; car stays a test oracle in Suggests.
ltsummary 0.7.0
-
tbl_hierarchical()andtbl_hierarchical_count()build nested rate and count tables (adverse events by system organ class and preferred term, for example) with thevariables,id,denominator,by,include,statistic,overall_row,labelanddigitsarguments. Rates count each subject once per cell viaid, and an ordered-factor last variable tabulates each subject at its highest level. gtsummary computes these tables on its cards ARD stack; ltsummary counts directly in base R, and the outputs match cell for cell in the parity suite (decisions/0020). Two upstream failures are fixed rather than mirrored: an ordered factor in a count table (upstream crashes), and a count-tablestatisticusing{N}or{p}(a clean error here). -
add_overall()gains methods for both hierarchical classes; the overall column of a rate table counts each subject once across the whole data, and a count table without a denominator gets a plain"**Overall**"header. -
sort_hierarchical()reorders the sections of a hierarchical table descending by their summed counts (ties keep their order, and sorting a variable outsideincludesums its children’s rates with a message) or alphanumerically, per variable.filter_hierarchical()keeps the rows of a target variable whose statistics satisfy an expression overn,Nandpacross the columns, thebyvalues, per-columnn_1-style statistics and the*_overallsums, with thevar,keep_emptyandquietarguments; emptied sections lose their summary rows unlesskeep_empty, and the overall row always stays. -
tbl_likert()builds a wide table of factor variables that share the same levels, one column per level, with thestatistic,label,digits,includeandsortarguments. Only{n},{N}and{p}are available, the percentage denominator is each variable’s non-missing count, and the table carries no footnote, as in gtsummary.add_n()works on the table with itstbl_summary()interface. -
tbl_wide_summary()places summary statistics wide, one column per element of thestatisticcharacter vector, with thelabel,digits,type,value,sortandincludearguments. All variables must be of one summary kind, continuous or categorical/dichotomous, and the table carries no footnote and no missing rows, as in gtsummary. See decisions/0019 for the design of the three new summary builders. -
tbl_custom_summary()computes each cell with a function you supply, called per cell withx,data,full_data,variable,byandstrataexactly as gtsummary 2.5.1 calls it (thetypeandstat_displayarguments its documentation promises are not passed there either).overall_rowadds a row summarizing all observations, andadd_overall(),add_p(),add_n(),add_stat_label(),inline_text()and the styling functions work as ontbl_summary().ratio_summary()andproportion_summary()build ready-madestat_fnsfunctions, the Poisson-test ratio and the base-R proportion intervals ofadd_ci().continuous_summary()is hard-deprecated in gtsummary 2.5.1 and is not mirrored. -
tbl_split_by_rows()andtbl_split_by_columns()split one table into a list of tables: after selected variables, after row numbers, at each value of a body column, or by groups of columns repeated next to thekeyscolumns. Thefootnotesandcaptionarguments place the abbreviations, source notes and caption on the first, the last, or every table. The list prints one table after another, renders in knitr, litedown and pkgdown documents, and its class isc("ltsummary_split", "tbl_split", "list")so it never collides with gtsummary’s print method; see decisions/0018.print()arguments such asprint_enginereach each table, and agroupscolumn that does not exist raises a clean error naming it (upstream errors without a message). -
add_variable_group_header()inserts a header row above a group of variables and indents the group, with theheader,variablesandindentarguments. The inserted row hasrow_type = "variable_group", sobold_labels()bolds the group’s variable labels but not the header, as in gtsummary. -
combine_terms()collapses the terms a formula update removes from a regression model into one row, with a p-value fromstats::anova()and thelabeland...(passed toanova()) arguments. Two situations that error in gtsummary work here: tables built withconf.int = FALSE, and models whose data lives in a calling function’s environment (the reduced model is refit in the formula’s environment). -
separate_p_footnotes()replaces the combinedadd_p()oradd_difference()footnote with individual footnotes naming the test behind each p-value. -
tbl_butcher()removes every element of a table except those needed to print it, plus any element named ininclude. Functions that add or modify statistics no longer run on the butchered table;inline_text()cell quoting still works.
ltsummary 0.6.0
-
add_difference_row()adds rows below each variable comparing every other level of thebyvariable against areferencelevel, with thestatistic,test,group,header,adj.vars,test.args,conf.level,include,pvalue_funandestimate_funarguments. Each comparison runs on the two levels’ subset with the reference level first, so the estimate is reference minus compared, shown in the compared level’s column; the reference column shows an em dash. Two upstream bugs are fixed rather than mirrored: a statistic the method does not return raises a clean error naming the statistic and the method, and a numericreferenceon a numericbyis accepted. See the addendum to decisions/0012. - Testing policy: quantitative expectations are now anchored to independent oracles computed in the tests (
stats::/survival::calls or hand arithmetic) instead of values pasted from gtsummary runs; formatting rules are hand-derived from the documented rounding cascades. Parity with gtsummary 2.5.1 is verified live in the parity suite, which gains thestyle_*()functions, the Poisson family andadd_difference_row(). See decisions/0016.
ltsummary 0.5.0
Themes.
set_ltsummary_theme()activates a named list of theme elements that changes the package’s defaults, withget_ltsummary_theme(),reset_ltsummary_theme(),check_ltsummary_theme()and the scopedwith_ltsummary_theme(). The element names are gtsummary’s ("tbl_summary-arg:statistic","pkgwide-str:language", …), so a theme list written for gtsummary carries over; the functions carry the ltsummary name, the one deliberate naming difference between the packages. An explicit argument beats the theme, and the theme beats theltsummary.*options. See decisions/0015.Theme constructors:
theme_ltsummary_compact()(smaller font and cell padding, through the new"as_lt-lst:table_style"element),theme_ltsummary_journal()(JAMA, NEJM, The Lancet and, in part, The Quarterly Journal of Economics),theme_ltsummary_language()(sixteen languages, with gtsummary 2.5.1’s translation table embedded),theme_ltsummary_continuous2(),theme_ltsummary_mean_sd()andtheme_ltsummary_eda().theme_gtsummary_printer()is not mirrored.tbl_continuous()summarizes a continuous variable within the levels of one or more categorical variables, with thevariable,include,digits,by,statistic,labelandvaluearguments. The statistics describe the continuous variable, so the continuous statistic names oftbl_summary()apply, and the footnote opens with its label (“Age: Median (Q1, Q3)”).add_p()on a continuous summary table computes a two-way ANOVA (the omnibus F-test oflm(variable ~ include + by), in base R) when the table has abyvariable, and the swappedtbl_summary()defaults when it does not.add_overall()andinline_text()work as in gtsummary;add_n(),add_stat_label(),add_ci()andadd_difference()have notbl_continuousmethod there and none here. Theaov,lme4andancova_lme4tests are not mirrored. See decisions/0014.Custom test functions receive a
continuous_variableargument when called from a continuous summary table.
ltsummary 0.4.0
The functions that combine tables, with the interface of gtsummary 2.5.1 and the computations in base R.
-
tbl_stack()appends two or more tables with thegroup_header,quiet,attr_order,tbl_idsandtbl_id_lblsarguments. A hiddentbl_id1column records which table each row came from and every stored styling instruction is scoped to it, so the inputs keep their formatting, footnotes and merged columns. Group headers render as full-width lt row groups. -
tbl_merge()joins tables side by side with thetab_spanner,merge_vars,tbl_idsandquietarguments. Each table’s columns are renamed with its position (stat_1_1,estimate_2, …), its styling follows the renamed columns, and the spanning headers accept the{N}-style header statistics. -
tbl_strata()andtbl_strata2()build one table per stratum and combine them, with thestrata,.tbl_fun,.sep,.combine_with,.combine_argsand.headerarguments; the strata and their headers are recorded indf_strata.tbl_strata2()passes the evaluated header to.tbl_funas.y. The deprecated.quietargument is not mirrored. -
tbl_strata_nested_stack()stacks the per-stratum tables with the strata as nested, indented row headers, with therow_headerandquietarguments. The row headers live in rows with a positive hiddentbl_indent_id1column, somodify_bold(columns = label, rows = tbl_indent_id1 > 0)styles them. -
inline_text()works on stacked and merged tables (and on tables built withas_ltsummary()): the cell is addressed byvariable,levelandcolumn, or apatternis glued over the row. -
show_header_names()lists every header statistic a table carries, whatever its name. - Every new function is checked cell for cell against gtsummary 2.5.1 in the test suite when gtsummary and broom are installed; the regression examples also need broom.helpers and survival. See decisions/0013.
Changes to the regression tables since 0.3.0:
-
tbl_uvregression()is built on the stacking core: itstable_bodystarts with a hiddentbl_id1column and each model’s styling stays scoped to its own rows. -
bold_labels()and friends on a stacked table with group headers target the label column, not the hidden group column.
ltsummary 0.3.0
Cross tables, survival tables, differences between groups and confidence intervals, with the interface of gtsummary 2.5.1 and the computations in base R.
-
tbl_cross()builds a cross table of two categorical variables with therow,col,label,statistic,digits,percent,margin,missing,missing_textandmargin_textarguments.add_p()on a cross table compares the two variables, withsource_note = TRUEto report the p-value below the table, andinline_text()selects cells withrow_levelandcol_level. -
tbl_survfit()summarizessurvival::survfit()curves from asurvfitobject, a list of them, or a data frame withyandinclude: survival probabilities attimesor survival quantiles atprobs, with thestatistic,label,label_header,estimate_fun,missingandtypearguments. Competing-risks models show the probability of the first state.add_p()on a survival table computes the log-rank, G-rho family and Cox regression tests from the formula and data of thesurvfit()call,add_n()andadd_nevent()add the counts, andinline_text()selects a column bytimeorprob.{time}and{prob}are available inlabel_headerandmodify_header(), andshow_header_names()lists them. See decisions/0011. -
add_difference()adds the difference between two groups with its confidence interval and p-value: the difference in means (t.test,paired.t.test, orancovawithadj.vars), the Hodges-Lehmann difference in location (wilcox.test), the difference in proportions (prop.test) and the standardized mean difference (smd, computed in base R assmd::smd()does), with thetest,group,adj.vars,test.args,conf.level,include,pvalue_funandestimate_funarguments.add_p(adj.vars =)runs the same ANCOVA for continuous variables. The methods that need effectsize, emmeans or lme4 are not mirrored; see decisions/0012. -
add_ci()adds the confidence interval of each cell’s proportion or mean next to the statistic column, with themethod(wilson,wilson.no.correct,exact,wald,wald.no.correct,agresti.coullandjeffreysfor proportions,t.testandwilcox.testfor means, all in base R),include,statistic,conf.level,style_funandpatternarguments. It follows the table’spercentdenominator and covers the column added byadd_overall(). -
add_stat()adds columns of statistics computed by your own functions, on the label, level or missing rows. -
?testsdocuments the methods ofadd_difference()and the tests oftbl_survfit() |> add_p()next to those ofadd_p(), and custom test functions receiveadj.vars. - Every new function is checked cell for cell against gtsummary 2.5.1 in the test suite when gtsummary and broom are installed; the survival block also needs survival, the standardized mean differences need smd, and the ANCOVA needs broom.helpers.
Changes to the descriptive tables since 0.2.0:
- Two rules of gtsummary’s result handling are adopted in
add_p(): a test that fails leaves every statistic missing, so the hiddenestimate,statisticand other columns exist either way, and a statistic column is added only when some test returns it. -
add_p(adj.vars =)is no longer an error; continuous variables default to"ancova"whenbyhas two levels.
ltsummary 0.2.0
Regression tables, with the interface of gtsummary 2.5.1 and the tidying done in base R.
-
tbl_regression()summarizeslm,glmandcoxphmodels: estimates, confidence intervals and p-values, with label rows, reference rows and indented levels for categorical variables, interaction terms labelled by their parts, and thelabel,exponentiate,include,show_single_row,conf.level,intercept,estimate_fun,pvalue_fun,tidy_fun,add_estimate_to_reference_rowsandconf.intarguments. Other model classes are tidied withbroom::tidy()or atidy_fun. The intervals are the ones broom reports: t-based forlm, profile likelihood forglm, Wald forcoxph. -
tbl_uvregression()fits one model per variable, withyorx, and stacks the results. -
add_global_p()adds one p-value per variable from the type III tests ofcar::Anova(), computed in base R byglobal_pvalue_fun();add_n()andadd_nevent()add observation and event counts on label or level rows;add_glance_table()andadd_glance_source_note()add model statistics, computed in base R byglance_fun_s3()for the three model classes. -
add_q()adds q-values adjusted for multiple comparisons,sort_p()andfilter_p()order and subset a table by p-value; all three work on summary tables too. -
inline_text()gains methods for regression tables, with theestimate_funargument and the pattern"{estimate} ({conf.level*100}% CI {conf.low}, {conf.high}; {p.value})". - The selectors
all_interaction(),all_intercepts()andall_contrasts();{N_event}in headers;show_header_names()listsN_event*when a table has events. - The output of every regression function is checked cell for cell against gtsummary 2.5.1 in the test suite when gtsummary, broom.helpers, car and parameters are installed. See decisions/0010 for the design.
- gtsummary’s authors are credited in the README,
DESCRIPTIONandLICENSE.md: ltsummary re-implements the interface they designed, and its documentation follows theirs.
Changes to the descriptive tables since 0.1.0:
- Documentation rewritten to the depth of gtsummary’s. Reference pages have argument sections where they help (
tbl_summary(),add_p(),modify_table_styling(),tests) and numbered examples that render as tables; the reference index follows gtsummary’s grouping; six articles were added:- the
tbl_summary()andinline_text()tutorials, - the modifier functions walkthrough,
- the FAQ and gallery,
- Quarto and R Markdown,
- the definition of an ltsummary object.
- the
- Column selections combine positive and negative elements the way tidyselect does, e.g.
include = c(age:grade, -marker)andstatistic = c(everything(), -grade) ~ "{n}". -
add_stat_label(label = variable ~ NA_character_)blanks the statistic label, as in gtsummary. -
print()writes the table into the document when called while knitting, soprint(tbl)in a loop withresults = "asis"works. -
as_lt()renders a single row of spanning headers, the most lt can show;modify_spanning_header(level = 2)stores the header and says so. See decisions/0009. - The parity tests against gtsummary also need broom, which gtsummary’s
add_p()uses; broom is listed inSuggestsand the tests skip without it. - A
modify_footnote_body()whoserowsmatched no rows made the table fail to render; it is now ignored. - A logical vector inside
c()in a column selection is treated as one mask, so the error for a vector of the wrong length reports that vector’s length.
ltsummary 0.1.0
First release. Descriptive summary tables with the interface of gtsummary 2.5.1, computed in base R and rendered with lt.
-
tbl_summary()with theby,label,statistic,digits,type,value,missing,missing_text,missing_stat,sort,percentandincludearguments.missingalso accepts a formula list. -
add_overall(),add_n(),add_p()with twelve tests from the stats package and support for custom test functions, andadd_stat_label(). - The modifier functions:
- headers:
modify_header(),modify_spanning_header(),remove_spanning_header(),show_header_names(); - footnotes:
modify_footnote_header(),modify_footnote_body(),modify_footnote_spanning_header()and theirremove_*()counterparts; - notes:
modify_abbreviation()(vectorized, withprefix,sep1andsep2),remove_abbreviation(),modify_caption(),modify_source_note(),remove_source_note(); - columns and cells:
modify_column_hide(),modify_column_unhide(),modify_column_alignment(),modify_indent(),modify_column_merge(),remove_column_merge(),modify_fmt_fun(),modify_post_fmt_fun(),modify_missing_symbol(); - emphasis:
bold_labels(),bold_levels(),italicize_labels(),italicize_levels(),bold_p(),modify_bold(),modify_italic(),remove_bold(),remove_italic(); - rows:
remove_row_type().
- headers:
-
style_number(),style_percent(),style_pvalue(),style_sigfig(),style_ratio()and thelabel_style_*()factories. -
inline_text()for quoting cells and patterns of statistics in report text. -
as_lt()plus print, format, knitr, litedown and pkgdown methods andas.data.frame(). -
as_ltsummary(),modify_table_body(),modify_table_styling(),assign_summary_type()andassign_summary_digits()for building on the object model. - The simulated
trialdata set, with the same columns and labels as gtsummary’s. - Formatted output is checked against gtsummary 2.5.1 in the test suite when gtsummary and broom are installed.