Skip to content

Commit

Permalink
Add rtables.officer as a dependency (#289)
Browse files Browse the repository at this point in the history
Changes:
1. Updates the `rtables` version
2. Adds `rtables.officer` as a new dependency

Note that this blocks CRAN release of `teal.reporter` untill the
`rtables.officer` and `rtables` is released.
  • Loading branch information
vedhav authored Nov 19, 2024
1 parent 4fefa7e commit 953bca0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ repos:
- zip
- rlistings
- rtables
- rtables.officer
- id: spell-check
name: Check spelling with `spelling`
exclude: >
Expand Down
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions staged_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ upstream_repos:
insightsengineering/rtables:
repo: insightsengineering/rtables
host: https://github.com
insightsengineering/rtables.officer:
repo: insightsengineering/rtables.officer
host: https://github.com
insightsengineering/rlistings:
repo: insightsengineering/rlistings
host: https://github.com
Expand Down

0 comments on commit 953bca0

Please sign in to comment.