Skip to content

v1.4.0

Latest

Choose a tag to compare

@rich-iannone rich-iannone released this 15 Oct 13:21
· 1 commit to master since this release
2be0fd1

New features

  • The new rows_hide() and rows_unhide() functions control row visibility, mirroring cols_hide() and cols_unhide(). Hidden rows are excluded from the rendered table but can still be targeted in rows expressions, and summary rows are calculated from the visible rows only. (#2127)

  • Numeric formatting functions (fmt_number(), fmt_scientific(), fmt_engineering(), fmt_percent(), fmt_currency(), and others) gain a drop_leading_zero argument. Setting this to TRUE removes the leading zero from values between -1 and 1 (e.g., 0.75 becomes .75), which is useful for displaying correlations, p-values, and other bounded statistics (#2146). (#2155)

  • Tables can now be saved as PowerPoint files with gtsave() by using the .pptx file extension. This is powered by a new OOXML rendering engine that aims to unify Word and PowerPoint output (#97). (@thebioengineer, @romainfrancois, #2158)

  • gt_group() can now combine gt_group objects with gt_tbl objects (#2128). (@shannonhaughton, #2129)

  • Tables with no data rows now display a locale-appropriate message (e.g., "Table has no data") in the body area for both HTML and LaTeX output. The message can be customized via tab_options(table.no_data_message = "...") or suppressed by setting it to "" (#1881).

Upcoming changes

  • gt's internals and documentation now use the base pipe (|>) throughout. gt still re-exports %>%, dplyr::vars(), and tidyselect::one_of(), but these re-exports will be removed in a future release. Packages relying on them should import them directly from magrittr, dplyr, or tidyselect. (@olivroy, #2150)

Minor improvements and bug fixes

  • Fixed LaTeX and RTF output for unformatted Date columns, which now show calendar dates instead of day counts since the Unix epoch (#2177). (@LeonidasZhak, #2180)

  • Rows in LaTeX output tables no longer overlap when cell text contains line breaks (#2178). (#2179)

  • Fixed cols_merge() with <</>> patterns producing corrupted output when data values contain < or > characters, particularly in LaTeX output (#2153). (#2156)

  • Fixed gt_split() failing on grouped data frames by filtering stale row group metadata after subsetting rows (#2089). (#2157)

  • Fixed md() in a column label causing the column to expand to full page width (\linewidth) in LaTeX/PDF output when no explicit column width is set (#2124). (#2162)

  • Fixed text_transform() passing HTML-escaped text (e.g., &amp;) to the user-supplied function instead of the original display text; functions like stringr::str_to_title() now receive and transform plain text as expected (#2033). (#2163)

  • Fixed text_replace() failing to match patterns containing LaTeX special characters (e.g., underscores) in LaTeX/PDF output. The same plain-text pattern now works consistently in both HTML and LaTeX (#1592). (#2165)

  • Styles applied with tab_style() to cells_column_spanners() are no longer dropped when tab_style() is called before tab_spanner() (#1438). (#2174)

  • The headers attributes on <td> elements in HTML output tables now match the id attributes of their column headings when column names contain spaces, improving accessibility (#2085). (#2173)

  • The vertical alignment of the row group column (with row_group_as_column = TRUE) can now be set with tab_style() through body cell styles. (#2176)

  • Fixed cell misalignment when using summary_rows(side = "top") with row_group.as_column = TRUE and no stub column (#1561). (#2175)

  • Styling can now be applied to summary rows in LaTeX output tables without error (#2117). (@thebioengineer, #2123)

  • Fixed multi-column stub rowspans incorrectly crossing row-group boundaries when adjacent groups share the same stub value, which caused group labels to appear in the wrong rows (#2121). (#2161)

  • Fixed grand summary rows rendering incorrectly in HTML output tables with a multi-column stub (#2164). (@ChidiebereNjoku, #2167)

  • Fixed higher-level column spanners not displaying correctly when a multi-column stub is present (#2170). (@ysaidani, #2171)

  • Fixed cells_stub() incorrectly resolving footnote row indices when a multi-column stub has repeated labels across non-contiguous groups (#2168). (@ysaidani, #2169)

  • Improved RTF handling of column headers and spanners in tables with a multi-column stub (#2118). (@thebioengineer, #2145)

  • Empty strings marked with md() are now handled correctly in Word output tables (#2119). (@thebioengineer, #2120)

  • The keep_with_next parameter is now applied consistently in as_word() (#2149). (@shannonhaughton, #2151)

  • Removed usage of dplyr::case_match(), which is deprecated as of dplyr 1.2.0. (@olivroy, #2125)

  • Fixed several typos in the documentation. (@jeis4wpi, #2152)