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

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()

Value

the text is returned invisibly

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

Examples


if (FALSE) {
  library(dplyr)
  ptdata()  %>% stable() %>% st2doc()
}

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