From 801e04271f96b23a43d163ab8c4e66531387f85a Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Sat, 13 Apr 2024 15:17:31 -0400 Subject: [PATCH 1/3] Comments for CRAN submission --- cran-comments.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/cran-comments.md b/cran-comments.md index 54322e7..d512854 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,16 +1,6 @@ -# tables 0.9.17 +# tables 0.9.24 -It didn't fix the issue; some of the example results in \donttest sections -were autoprinting as browsable HTML. +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.16 - -This version doesn't call browseURL() non-interactively -even in a \donttest section. Hopefully this will deal with the -"calibre" files. - -# tables 0.9.15 - -This is a relatively minor update, adding a few functions. The -reason to send it is that it is used in the R Tables Working Group -project. From e952e8a8a649535ae94b6438fe978592db902692 Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Sat, 13 Apr 2024 16:00:49 -0400 Subject: [PATCH 2/3] CRAN doesn't like formatters::matrix_print_form even if it is never called. --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/tables_mform.R | 12 ++++-------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1f86b42..d36847e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tables Title: Formula-Driven Table Generation -Version: 0.9.24 +Version: 0.9.25 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 5cd0edd..d87d080 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# tables 0.9.24 +# tables 0.9.25 - `PlusMinus()` and `Paste()` didn't handle formatting properly when multiple columns were involved (issue #13). diff --git a/R/tables_mform.R b/R/tables_mform.R index b036a1c..31ee128 100644 --- a/R/tables_mform.R +++ b/R/tables_mform.R @@ -52,14 +52,10 @@ matrix_form.tabular <- function(df) { # formatters has renamed the matrix_print_form function to # MatrixPrintForm - MatrixPrintForm <- - if (exists("MatrixPrintForm", envir=asNamespace("formatters"))) - formatters::MatrixPrintForm - else if (exists("matrix_print_form", envir=asNamespace("formatters"))) - formatters::matrix_print_form - else - stop("formatters::MatrixPrintForm does not exist") - + MatrixPrintForm <- try(get("MatrixPrintForm", envir = asNamespace("formatters"))) + if (inherits(MatrixPrintForm, "try-error")) + MatrixPrintForm <- get("matrix_print_form", envir = asNamespace("formatters")) + MatrixPrintForm(strings = strings, spans = spans, aligns = aligns, From b0ea906c765ca4be890b328d8d6c057a4d5c5ea8 Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Sat, 13 Apr 2024 16:04:11 -0400 Subject: [PATCH 3/3] Missed "silent=TRUE" --- R/tables_mform.R | 2 +- cran-comments.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/R/tables_mform.R b/R/tables_mform.R index 31ee128..d4e015b 100644 --- a/R/tables_mform.R +++ b/R/tables_mform.R @@ -52,7 +52,7 @@ matrix_form.tabular <- function(df) { # formatters has renamed the matrix_print_form function to # MatrixPrintForm - MatrixPrintForm <- try(get("MatrixPrintForm", envir = asNamespace("formatters"))) + MatrixPrintForm <- try(get("MatrixPrintForm", envir = asNamespace("formatters")), silent = TRUE) if (inherits(MatrixPrintForm, "try-error")) MatrixPrintForm <- get("matrix_print_form", envir = asNamespace("formatters")) diff --git a/cran-comments.md b/cran-comments.md index d512854..ecb84ff 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,8 @@ +# 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