Skip to content

Commit df86e0c

Browse files
authored
v0.3.1 Release Candidate (#821)
* Increment version number * Update NEWS.md * Update .Rbuildignore * Run examples only interactively * Update .Rbuildignore * Modify README
1 parent bc28dde commit df86e0c

File tree

9 files changed

+74
-29
lines changed

9 files changed

+74
-29
lines changed

.Rbuildignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
^README\.Rmd$
1212
^README\.md$
1313
^LICENSE\.md$
14-
tests/gt-examples
1514
vignettes
1615
man/figures/.*svg$
1716
man/figures/[^m].*png$
17+
tests/gt-examples

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Type: Package
22
Package: gt
3-
Version: 0.3.0.9000
3+
Version: 0.3.1
44
Title: Easily Create Presentation-Ready Display Tables
55
Description: Build display tables from tabular data with an easy-to-use set of
66
functions. With its progressive approach, we can construct display tables

NEWS.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
1-
# gt (development version)
1+
# gt 0.3.1
2+
3+
## New features
4+
5+
* We now have the `force_sign` argument in several numeric formatting functions (`fmt_number()`, `fmt_integer()`, `fmt_scientific()`, `fmt_engineering()`, `fmt_percent()`, `fmt_currency()`, and `fmt_bytes()`). This makes it possible to force the appearance of the positive sign for positive values (#773). (#793)
6+
7+
* It's now possible to add padding to the column labels and heading locations in HTML tables with two new arguments added to `tab_options()`: `column_labels.padding` and `heading.padding`. Several options already exist for easily changing the vertical padding of certain locations, so, these additions make it possible to fully alter to the padding from top to bottom (without resorting to using CSS) (#770). (#795)
8+
9+
* The `whitespace` argument has been added to `cell_text()` and this provides many options for making whitespace easier to handle in HTML output tables (#714). (#797)
10+
11+
## Minor improvements and bug fixes
12+
13+
* Fixed LaTeX rendering for tables that have a stub; now data row cells are correctly laid out.
14+
15+
* LaTeX output tables now properly render summary rows. In addition, grand summary rows are now rendered in LaTeX outputs (previously, grand summary rows were ignored). This clears the long-standing issue in #625. (#768)
16+
17+
* Titles and optional subtitles in LaTeX output tables have an improved appearance, and the underlying code was rewritten to guard against more edge cases that might lead to failing LaTeX output. (#779)
18+
19+
* The `data` argument in the `cols_label()` and `cols_width()` functions was renamed to `.data` to avoid a partial matching issue (raised in #715). (#772)
20+
21+
* Fixed a bug where styles may not be applied correctly to summary row cells in HTML output tables (#752). (#782)
22+
23+
* Incorporated the full use of X11 color names for styling HTML tables. Now, named colors like `gray50` won't throw an error. Additionally, CSS3 colors that have no equivalent in X11 (like `Crimson` and `RebeccaPurple`) will now also just work (#712). (#787)
24+
25+
* Fixed a bug that occurs in the following rare circumstance: when using `summary_rows()` with no stub, a new column is generated internally and given the name rowname; but this can conflict with a column that has the same name, generating duplicate column names and not erroring at that instant (#749). (#792)
26+
27+
* The image generation functions `local_image()` and `web_image()` are enhanced such that multiple image paths/URLs can now be handled without errors. Thanks, @primaj for the initial work on this in #738. Fixes #510. (#803)
28+
29+
* Fixed a bug that occurs when using a `font` with the `cell_text()` along with other styles. Fixes #661 and #802. (#805)
30+
31+
* Implemented a fix for the situation where `tab_style()` is used along with `cells_summary()` as a location and, also, `row_group_order()` is used to reorder row groups. This resulted in a non-application of the style to the targeted summary cells (#812). (#814)
232

333
# gt 0.3.0
434

R/export.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ gtsave_filename <- function(path, filename) {
297297
#' clients over using CSS in a `<style>` block.
298298
#'
299299
#' @examples
300+
#' if (interactive()) {
301+
#'
300302
#' # Use `gtcars` to create a gt table;
301303
#' # add a header and then export as
302304
#' # HTML code with CSS inlined
@@ -320,6 +322,8 @@ gtsave_filename <- function(path, filename) {
320322
#' substr(1, 700) %>%
321323
#' cat()
322324
#'
325+
#' }
326+
#'
323327
#' @family Export Functions
324328
#' @section Function ID:
325329
#' 13-2
@@ -362,6 +366,8 @@ as_raw_html <- function(data,
362366
#' @param data A table object that is created using the [gt()] function.
363367
#'
364368
#' @examples
369+
#' if (interactive()) {
370+
#'
365371
#' # Use `gtcars` to create a gt table;
366372
#' # add a header and then export as
367373
#' # an object with LaTeX code
@@ -386,6 +392,8 @@ as_raw_html <- function(data,
386392
#' as.character() %>%
387393
#' cat()
388394
#'
395+
#' }
396+
#'
389397
#' @family Export Functions
390398
#' @section Function ID:
391399
#' 13-3
@@ -458,6 +466,8 @@ as_latex <- function(data) {
458466
#' or `"header"`. By default, page numbering is not active (`"none"`).
459467
#'
460468
#' @examples
469+
#' if (interactive()) {
470+
#'
461471
#' # Use `gtcars` to create a gt table;
462472
#' # add a header and then export as
463473
#' # RTF code
@@ -472,6 +482,8 @@ as_latex <- function(data) {
472482
#' ) %>%
473483
#' as_rtf()
474484
#'
485+
#' }
486+
#'
475487
#' @family Export Functions
476488
#' @section Function ID:
477489
#' 13-4

README.Rmd

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ knitr::opts_chunk$set(
1616
# gt <img src="man/figures/logo.svg" align="right" height="250px" />
1717

1818
<!-- badges: start -->
19-
[![Lifecycle:
20-
maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
2119
[![CRAN
2220
status](https://www.r-pkg.org/badges/version/gt)](https://cran.r-project.org/package=gt)
2321
[![R build
@@ -30,7 +28,7 @@ With the **gt** package, anyone can make wonderful-looking tables using the **R*
3028

3129
<p align="center"><img src="man/figures/gt_parts_of_a_table.svg" width="800px"></p>
3230

33-
It all begins with preprocessed **table data** (be it a tibble or a data frame). You then decide how to compose your **gt table** with the elements and formatting you need for the task at hand. Finally, the table is rendered by printing it at the console, including it in an R Markdown document, or exporting to a file using `gtsave()`. Currently, **gt** supports **HTML** output, with **LaTeX** and **RTF** planned for the future.
31+
It all begins with **table data** (be it a tibble or a data frame). You then decide how to compose your **gt table** with the elements and formatting you need for the task at hand. Finally, the table is rendered by printing it at the console, including it in an R Markdown document, or exporting to a file using `gtsave()`. Currently, **gt** supports the **HTML**, **LaTeX**, and **RTF** output formats.
3432

3533
<p align="center"><img src="man/figures/gt_workflow_diagram.svg" width="800px"></p>
3634

@@ -53,7 +51,7 @@ sp500 %>%
5351
gt() %>%
5452
tab_header(
5553
title = "S&P 500",
56-
subtitle = glue::glue("{start_date} to {end_date}")
54+
subtitle = glue("{start_date} to {end_date}")
5755
) %>%
5856
fmt_date(
5957
columns = date,
@@ -107,9 +105,9 @@ The **gt** package joins a burgeoning collection of packages for display table g
107105
- the formatting options are 'batteries included' (scientific notation, uncertainty, ranges, percentages, suffixes, localized currency, dates/times + much more)
108106
- there is excellent, pain-free support for footnotes
109107
- the output is 'camera-ready'
110-
- it will eventually support multiple output formats (including LaTeX) with the same declarative interface
108+
- multiple output formats are supported with the same declarative interface
111109
- the API closely follows tidyverse conventions by adhering to the [tidyverse style guide](https://style.tidyverse.org)
112-
- a focus on making the package documentation and examples the best they can be
110+
- there's a focus on making the package documentation and examples the best they can be
113111
- rigorous QA/QC measures: high test coverage for automated tests, and thorough manual testing by QA engineers (with every proposed code change)
114112

115113
While **gt** is trying to do something different with its own interface, it may not suit your specific needs. Here is a listing of other leading table-making **R** packages, with links to their respective project pages:
@@ -132,10 +130,7 @@ While **gt** is trying to do something different with its own interface, it may
132130

133131
#### Code of Conduct
134132

135-
Please note that the gt project is released with a [contributor
136-
code of
137-
conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/).<br>By
138-
participating in this project you agree to abide by its terms.
133+
Please note that the gt project is released with a [contributor code of conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/).<br>By participating in this project you agree to abide by its terms.
139134

140135
#### 📄 License
141136

README.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
<!-- badges: start -->
77

8-
[![Lifecycle:
9-
maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
108
[![CRAN
119
status](https://www.r-pkg.org/badges/version/gt)](https://cran.r-project.org/package=gt)
1210
[![R build
@@ -25,13 +23,12 @@ These include the *table header*, the *stub*, the *column labels* and
2523
<img src="man/figures/gt_parts_of_a_table.svg" width="800px">
2624
</p>
2725

28-
It all begins with preprocessed **table data** (be it a tibble or a data
29-
frame). You then decide how to compose your **gt table** with the
30-
elements and formatting you need for the task at hand. Finally, the
31-
table is rendered by printing it at the console, including it in an R
32-
Markdown document, or exporting to a file using `gtsave()`. Currently,
33-
**gt** supports **HTML** output, with **LaTeX** and **RTF** planned for
34-
the future.
26+
It all begins with **table data** (be it a tibble or a data frame). You
27+
then decide how to compose your **gt table** with the elements and
28+
formatting you need for the task at hand. Finally, the table is rendered
29+
by printing it at the console, including it in an R Markdown document,
30+
or exporting to a file using `gtsave()`. Currently, **gt** supports the
31+
**HTML**, **LaTeX**, and **RTF** output formats.
3532

3633
<p align="center">
3734
<img src="man/figures/gt_workflow_diagram.svg" width="800px">
@@ -59,7 +56,7 @@ sp500 %>%
5956
gt() %>%
6057
tab_header(
6158
title = "S&P 500",
62-
subtitle = glue::glue("{start_date} to {end_date}")
59+
subtitle = glue("{start_date} to {end_date}")
6360
) %>%
6461
fmt_date(
6562
columns = date,
@@ -128,12 +125,12 @@ contributes to this ecosystem:
128125
currency, dates/times + much more)
129126
- there is excellent, pain-free support for footnotes
130127
- the output is ‘camera-ready’
131-
- it will eventually support multiple output formats (including LaTeX)
132-
with the same declarative interface
128+
- multiple output formats are supported with the same declarative
129+
interface
133130
- the API closely follows tidyverse conventions by adhering to the
134131
[tidyverse style guide](https://style.tidyverse.org)
135-
- a focus on making the package documentation and examples the best
136-
they can be
132+
- there’s a focus on making the package documentation and examples the
133+
best they can be
137134
- rigorous QA/QC measures: high test coverage for automated tests, and
138135
thorough manual testing by QA engineers (with every proposed code
139136
change)
@@ -161,8 +158,7 @@ pages:
161158

162159
#### Code of Conduct
163160

164-
Please note that the gt project is released with a [contributor
165-
code of
161+
Please note that the gt project is released with a [contributor code of
166162
conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/).<br>By
167163
participating in this project you agree to abide by its terms.
168164

man/as_latex.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/as_raw_html.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/as_rtf.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)