From 533f566cec12a291093d6be4b0a983beca6f65d2 Mon Sep 17 00:00:00 2001 From: vedhav Date: Mon, 18 Nov 2024 12:53:32 +0530 Subject: [PATCH] chore: add `rtables.officer` dependency --- .pre-commit-config.yaml | 1 + DESCRIPTION | 10 ++++++---- R/utils.R | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e13b534..4a485d69 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,6 +32,7 @@ repos: - zip - rlistings - rtables + - rtables.officer - id: spell-check name: Check spelling with `spelling` exclude: > diff --git a/DESCRIPTION b/DESCRIPTION index 3fffda69..7d3a9cca 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,7 +32,8 @@ Imports: R6, rlistings (>= 0.2.8), rmarkdown (>= 2.23), - rtables (>= 0.6.6), + rtables (>= 0.6.10.9004), + rtables.officer (>= 0.0.1.9005), shiny (>= 1.6.0), shinybusy (>= 0.3.2), shinyWidgets (>= 0.5.1), @@ -56,9 +57,10 @@ RdMacros: Config/Needs/verdepcheck: rstudio/bslib, mllg/checkmate, davidgohel/flextable, rstudio/htmltools, yihui/knitr, r-lib/lifecycle, r-lib/R6, insightsengineering/rlistings, rstudio/rmarkdown, - insightsengineering/rtables, rstudio/shiny, dreamRs/shinybusy, - dreamRs/shinyWidgets, yaml=vubiostat/r-yaml, r-lib/zip, rstudio/DT, - yihui/formatR, insightsengineering/formatters, tidyverse/ggplot2, + insightsengineering/rtables, insightsengineering/rtables.officer, + rstudio/shiny, dreamRs/shinybusy, dreamRs/shinyWidgets, + yaml=vubiostat/r-yaml, r-lib/zip, rstudio/DT, yihui/formatR, + insightsengineering/formatters, tidyverse/ggplot2, deepayan/lattice, cran/png, r-lib/testthat, rstudio/tinytex, r-lib/withr Config/Needs/website: insightsengineering/nesttemplate diff --git a/R/utils.R b/R/utils.R index 363b6d74..c86e4222 100644 --- a/R/utils.R +++ b/R/utils.R @@ -125,7 +125,7 @@ panel_item <- function(title, ..., collapsed = TRUE, input_id = NULL) { #' @keywords internal to_flextable <- function(content) { if (inherits(content, c("rtables", "TableTree", "ElementaryTable"))) { - ft <- rtables::tt_to_flextable(content) + ft <- rtables.officer::tt_to_flextable(content) } else if (inherits(content, "listing_df")) { mf <- rlistings::matrix_form(content) nr_header <- attr(mf, "nrow_header") @@ -140,9 +140,9 @@ to_flextable <- function(content) { rtables::main_footer(ft) <- mf$main_footer rtables::prov_footer(ft) <- mf$prov_footer rtables::header_section_div(ft) <- mf$header_section_div - ft <- rtables::tt_to_flextable(ft, total_width = c(grDevices::pdf.options()$width - 1)) + ft <- rtables.officer::tt_to_flextable(ft, total_width = c(grDevices::pdf.options()$width - 1)) } else if (inherits(content, "data.frame")) { - ft <- rtables::tt_to_flextable( + ft <- rtables.officer::tt_to_flextable( rtables::df_to_tt(content) ) } else {