knitr::opts_chunk$set(
  collapse = TRUE,
  warning = FALSE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

R-CMD-check gt.doc.images status badge

gt.doc.images

Package exports two functions

Install package from the R Universe with

install.packages('gt.doc.images', 
                 repos = c(ddsjoberg = 'https://ddsjoberg.r-universe.dev',
                           CRAN = 'https://cloud.r-project.org'))

Example below from the {gtsummary} package saving the example gt table images.

> gt.doc.images::save_help_file_images()
#> 
#> -- gtsummary (C:/Users/SjobergD/GitHub/gtsummary) ------------------------------
#> 
#> -- Working on add_ci.Rd 
#> √ Saving add_ci_ex1.png
#> 
#> -- Working on add_difference.Rd 
#> √ Saving add_difference_ex1.png
#> √ Saving add_difference_ex2.png
#> 
#> -- Working on tbl_split.Rd 
#> i No saved example objects in tbl_split.Rd

The saved images can be inserted into the help files to exhibit how the rendered tables appear. Include the following chunk in the {roxygen2} comments to insert an image.

#' @section Example Output:
#' \if{html}{Example 1}
#'
#' \if{html}{\figure{tbl_survfit_ex1.png}{options: width=55\%}}


ddsjoberg/gt.doc.images documentation built on Oct. 5, 2022, 10:16 a.m.