st2doc: Render a table a pdf document

View source: R/preview.R

st2docR Documentation

Render a table a pdf document

Description

Please consider using st2article() rather than this function. It does the same thing and likely will replace st2doc().

Usage

st2doc(
  text,
  preview = TRUE,
  output_dir = tempdir(),
  output_file = "st2doc.pdf",
  landscape = is_lscape(text)
)

Arguments

text

stable() output

preview

if TRUE, the rendered pdf file is opened using fs::file_show()

output_dir

passed to rmarkdown::render()

output_file

passed to rmarkdown::render()

landscape

passed to st_wrap()

Details

In order to render the table in the pdf document, the following packages must be installed, regardless of the type of table you are trying to render:

  1. threeparttable

  2. booktabs

  3. array

  4. longtable

  5. mathpazo

  6. pdflscape

Value

the text is returned invisibly

See Also

st2article(), st2report(), st2viewer()

Examples


## Not run: 
  library(dplyr)
  ptdata()  %>% stable() %>% st2doc()

## End(Not run)

template <- system.file("rmd", "st2doc.Rmd", package = "pmtables")
# cat(readLines(template), sep = "\n")


metrumresearchgroup/pmtables documentation built on Dec. 22, 2024, 1:34 a.m.