From e952e8a8a649535ae94b6438fe978592db902692 Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Sat, 13 Apr 2024 16:00:49 -0400 Subject: [PATCH] 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,