From 9cde93ab6da074e1ea55218529903b0a595d4ecd Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Tue, 2 May 2023 16:26:39 -0400 Subject: [PATCH] Autoprinting toHTML output also causes CRAN issues. --- DESCRIPTION | 2 +- NEWS.md | 2 +- cran-comments.md | 5 +++++ man/HTMLfootnotes.Rd | 3 ++- man/html.tabular.Rd | 12 ++++++++---- man/table_options.Rd | 5 +++-- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3789fca..8cf1591 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tables Title: Formula-Driven Table Generation -Version: 0.9.16 +Version: 0.9.17 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 747a8c6..f035918 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# tables 0.9.16 +# tables 0.9.17 - Change host to Github. - Add `useGroupLabels()` function. diff --git a/cran-comments.md b/cran-comments.md index d70939f..54322e7 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,8 @@ +# tables 0.9.17 + +It didn't fix the issue; some of the example results in \donttest sections +were autoprinting as browsable HTML. + # tables 0.9.16 This version doesn't call browseURL() non-interactively diff --git a/man/HTMLfootnotes.Rd b/man/HTMLfootnotes.Rd index 839f37b..a2b4abd 100644 --- a/man/HTMLfootnotes.Rd +++ b/man/HTMLfootnotes.Rd @@ -31,6 +31,7 @@ tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)* footnote <- HTMLfootnotes(tab, "This is a footnote with no marker.", "*" = "This is a footnote with an asterisk.") -toHTML(tab, options = list(doFooter = TRUE, +if (interactive()) + toHTML(tab, options = list(doFooter = TRUE, HTMLfooter = footnote)) } diff --git a/man/html.tabular.Rd b/man/html.tabular.Rd index f35256f..daf80ae 100644 --- a/man/html.tabular.Rd +++ b/man/html.tabular.Rd @@ -86,24 +86,28 @@ table_options(rowlabeljustification="c") f <- tempfile(fileext=".html") con <- file(f, "wt") -toHTML(tab, con, options=htmloptions(head=TRUE, table=FALSE)) +if (interactive()) + toHTML(tab, con, options=htmloptions(head=TRUE, table=FALSE)) writeLines("

This table has pad = FALSE. The centered numbers look sloppy.
", con) -toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=FALSE)) +if (interactive()) + toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=FALSE)) writeLines("

This table has pad = FALSE and justification=\"r\". The justification makes the columns of numbers look all right (except for the hyphens used as minus signs), but they are placed poorly relative to the labels.
", con) -toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=FALSE, justification="r")) +if (interactive()) + toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=FALSE, justification="r")) writeLines("

This one has pad = TRUE. It looks best, but if you cut and paste, the spacing characters may cause problems.
", con) -toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=TRUE)) +if (interactive()) + toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=TRUE)) table_options(save) close(con) diff --git a/man/table_options.Rd b/man/table_options.Rd index 7788819..3315c69 100644 --- a/man/table_options.Rd +++ b/man/table_options.Rd @@ -129,8 +129,9 @@ table_options(save) \donttest{ f <- tempfile(fileext = ".html") -toHTML(tab, f, - options=htmloptions(HTMLcaption="Table of Iris Data", +if (interactive()) + toHTML(tab, f, + options=htmloptions(HTMLcaption="Table of Iris Data", pad = TRUE)) } }