From 80d80a8b4e750390996d7ff704f3ff161e0efbbd Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:33:57 +0100 Subject: [PATCH] revert rd reorder; docs --- R/Viewer.R | 3 +-- R/tt_export.R | 13 +++++-------- man/export_as_docx.Rd | 13 +++++++++++++ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/R/Viewer.R b/R/Viewer.R index 715986e4f..3e86d306b 100644 --- a/R/Viewer.R +++ b/R/Viewer.R @@ -11,8 +11,6 @@ NULL #' #' @return not meaningful. Called for the side effect of opening a browser or viewer pane. #' -#' @export -#' #' @examples #' if (interactive()) { #' sl5 <- factor(iris$Sepal.Length > 5, @@ -39,6 +37,7 @@ NULL #' #' Viewer(tbl, tbl2) #' } +#' @export Viewer <- function(x, y = NULL, ...) { check_convert <- function(x, name, accept_NULL = FALSE) { if (accept_NULL && is.null(x)) { diff --git a/R/tt_export.R b/R/tt_export.R index cbbde332e..52d905897 100644 --- a/R/tt_export.R +++ b/R/tt_export.R @@ -53,8 +53,6 @@ import_from_tsv <- function(file) { #' @importFrom formatters export_as_txt #' -#' @export -#' #' @examples #' lyt <- basic_table() %>% #' split_cols_by("ARM") %>% @@ -69,6 +67,7 @@ import_from_tsv <- function(file) { #' export_as_txt(tbl, file = tf) #' system2("cat", tf) #' } +#' @export formatters::export_as_txt # data.frame output ------------------------------------------------------------ @@ -451,8 +450,6 @@ collapse_values <- function(colvals) { #' @importFrom formatters export_as_pdf #' -#' @export -#' #' @examples #' lyt <- basic_table() %>% #' split_cols_by("ARM") %>% @@ -466,6 +463,7 @@ collapse_values <- function(colvals) { #' tf <- tempfile(fileext = ".pdf") #' export_as_pdf(tbl, file = tf, lpp = 8) #' } +#' @export formatters::export_as_pdf # only used in pagination @@ -509,10 +507,6 @@ formatters::export_as_pdf #' `tt_to_flextable()`. #' } #' -#' @name export_as_docx -#' -#' @export -#' #' @seealso [tt_to_flextable()] #' #' @examples @@ -526,6 +520,9 @@ formatters::export_as_pdf #' \dontrun{ #' tf <- tempfile(fileext = ".docx") #' export_as_docx(tbl, file = tf, section_properties = section_properties_portrait()) +#' } +#' @name export_as_docx +#' @export export_as_docx <- function(tt, file, doc_metadata = NULL, diff --git a/man/export_as_docx.Rd b/man/export_as_docx.Rd index c5fdbccad..432d13fea 100644 --- a/man/export_as_docx.Rd +++ b/man/export_as_docx.Rd @@ -78,6 +78,19 @@ Only \code{title_as_header} and \code{footer_as_text} need to be specified again \code{tt_to_flextable()}. } } +\examples{ +lyt <- basic_table() \%>\% + split_cols_by("ARM") \%>\% + analyze(c("AGE", "BMRKR2", "COUNTRY")) + +tbl <- build_table(lyt, ex_adsl) + +# See how section_properties_portrait function is built for custom +\dontrun{ +tf <- tempfile(fileext = ".docx") +export_as_docx(tbl, file = tf, section_properties = section_properties_portrait()) +} +} \seealso{ \code{\link[=tt_to_flextable]{tt_to_flextable()}} }