Skip to content

Commit

Permalink
Merge pull request #21 from dmurdoch/formatterschanges
Browse files Browse the repository at this point in the history
formatters has renamed the `matrix_print_form` function
  • Loading branch information
dmurdoch authored Apr 13, 2024
2 parents ae8b8b5 + 1776151 commit 5b3c3fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tables
Title: Formula-Driven Table Generation
Version: 0.9.23
Version: 0.9.24
Author: Duncan Murdoch
Description: Computes and displays complex tables of summary statistics.
Output may be in LaTeX, HTML, plain text, or an R
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# tables 0.9.23
# tables 0.9.24

- `PlusMinus()` and `Paste()` didn't handle formatting properly
when multiple columns were involved (issue #13).
Expand All @@ -7,6 +7,7 @@ to file properly. (Reported by Reinhard Kerschner and F. Hortner.)
- In some cases `All()` would give an error (issue #17).
- `toTinytable()` function has been added to work with the
`tinytable` package.
- Minor update due to changes to the `formatters` package.

# tables 0.9.17

Expand Down
13 changes: 12 additions & 1 deletion R/tables_mform.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@ matrix_form.tabular <- function(df) {
formats <- matrix("xx", rows, cols)
row_info <- formatters::basic_pagdf(1:(rows - nrow(header)))
nrow_header <- nrow(header)
formatters::matrix_print_form(strings = strings,

# 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(strings = strings,
spans = spans,
aligns = aligns,
formats = formats,
Expand Down

0 comments on commit 5b3c3fc

Please sign in to comment.