From aa80bf98f7d4a0aea60c4d2505a9642fe1116a7c Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Mon, 24 Jun 2024 06:58:08 -0400 Subject: [PATCH 1/4] Work around change to formatters package. --- DESCRIPTION | 2 +- NEWS.md | 3 ++- cran-comments.md | 14 ++++---------- man/matrix_form.tabular.Rd | 3 ++- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 37c01fd..e30b117 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tables Title: Formula-Driven Table Generation -Version: 0.9.26 +Version: 0.9.27 Author: Duncan Murdoch Description: Computes and displays complex tables of summary statistics. Output may be in LaTeX, HTML, plain text, or an R diff --git a/NEWS.md b/NEWS.md index c312bc1..e1e5ff1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,10 @@ -# tables 0.9.26 +# tables 0.9.27 - A factor level of `""` caused an error when displayed. It will now be changed to `" "` for display (issue #19). - The `VignetteBuilder` field in `DESCRIPTION` has been changed to `rmarkdown` so that Pandoc can be found even when it is not on the `PATH`. +- Another minor update due to changes to the `formatters` package. # tables 0.9.25 diff --git a/cran-comments.md b/cran-comments.md index ecb84ff..01fe1a4 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,11 +1,5 @@ -# tables 0.9.25 - -Tried to handle the `formatters::matrix_print_form` differently, -so we never refer to something that isn't there. - -# tables 0.9.24 - -This is a minor release, fixing a few bugs and adding a function -at the request of the `tinytables` package. The submission was -triggered by a change to the exports of the `formatters` package. +# tables 0.9.27 +This is a small bug fix release. It also contains a fix for the +error reported by CRAN on June 21 to work with an update to the +formatters package. diff --git a/man/matrix_form.tabular.Rd b/man/matrix_form.tabular.Rd index f2c258a..fd1257e 100644 --- a/man/matrix_form.tabular.Rd +++ b/man/matrix_form.tabular.Rd @@ -56,7 +56,8 @@ if (requireNamespace("formatters")) { # This gives the breaks by columns, counting the # row label columns: - bycol <- formatters::vert_pag_indices(mform, cpp = 30, rep_cols = 2) + bycol <- formatters::vert_pag_indices(mform, cpp = 30, rep_cols = 2, + fontspec = formatters::font_spec()) # Display the table with both kinds of breaks for (i in seq_along(byrow)) { rows <- byrow[[i]] From 539bd88f02842105fb79f2b8004e2d6f9b25316b Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Mon, 24 Jun 2024 08:39:32 -0400 Subject: [PATCH 2/4] Work with both old and new versions. --- man/matrix_form.tabular.Rd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/man/matrix_form.tabular.Rd b/man/matrix_form.tabular.Rd index fd1257e..fc21529 100644 --- a/man/matrix_form.tabular.Rd +++ b/man/matrix_form.tabular.Rd @@ -55,9 +55,14 @@ if (requireNamespace("formatters")) { } # This gives the breaks by columns, counting the - # row label columns: - bycol <- formatters::vert_pag_indices(mform, cpp = 30, rep_cols = 2, + # row label columns. + # The formatters::vert_pag_indices function had an incompatible + # change in v0.5.8 + if (packageVersion("formatters") >= "0.5.8") + bycol <- formatters::vert_pag_indices(mform, cpp = 30, rep_cols = 2, fontspec = formatters::font_spec()) + else + bycol <- formatters::vert_pag_indices(mform, cpp = 30, rep_cols = 2) # Display the table with both kinds of breaks for (i in seq_along(byrow)) { rows <- byrow[[i]] From 4cf2804f257f395e683940397a4ac9188d0dfc6c Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Mon, 24 Jun 2024 12:59:26 -0400 Subject: [PATCH 3/4] Better test --- man/matrix_form.tabular.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/matrix_form.tabular.Rd b/man/matrix_form.tabular.Rd index fc21529..e749ca7 100644 --- a/man/matrix_form.tabular.Rd +++ b/man/matrix_form.tabular.Rd @@ -58,7 +58,7 @@ if (requireNamespace("formatters")) { # row label columns. # The formatters::vert_pag_indices function had an incompatible # change in v0.5.8 - if (packageVersion("formatters") >= "0.5.8") + if ("fontspec" \%in\% names(formals(formatters::vert_pag_indices))) bycol <- formatters::vert_pag_indices(mform, cpp = 30, rep_cols = 2, fontspec = formatters::font_spec()) else From 18cbbcee6423a8a3a992729febc91619ef855568 Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Mon, 24 Jun 2024 17:41:31 -0400 Subject: [PATCH 4/4] Better default value --- man/matrix_form.tabular.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/matrix_form.tabular.Rd b/man/matrix_form.tabular.Rd index e749ca7..b491c2f 100644 --- a/man/matrix_form.tabular.Rd +++ b/man/matrix_form.tabular.Rd @@ -60,7 +60,7 @@ if (requireNamespace("formatters")) { # change in v0.5.8 if ("fontspec" \%in\% names(formals(formatters::vert_pag_indices))) bycol <- formatters::vert_pag_indices(mform, cpp = 30, rep_cols = 2, - fontspec = formatters::font_spec()) + fontspec = NULL) else bycol <- formatters::vert_pag_indices(mform, cpp = 30, rep_cols = 2) # Display the table with both kinds of breaks