Use this function to wrap stable or stable_long objects so they can be included inline in an Rmarkdown document. Typically, call st_asis() (see examples).

st_wrap(x, ...)

# Default S3 method
st_wrap(
  x,
  con = stdout(),
  table = TRUE,
  center = TRUE,
  landscape = is_lscape(x),
  caption = NULL,
  short = NULL,
  float = c("H", "!ht"),
  context = c("rmd", "tex"),
  asis = FALSE,
  ...
)

# S3 method for class 'stable_long'
st_wrap(x, table = FALSE, ...)

# S3 method for class 'pmtable'
st_wrap(x, ...)

pt_wrap(x, ...)

st_asis(
  x,
  ...,
  caption = cap_main(x),
  short = cap_short(x),
  asis = TRUE,
  con = NULL
)

st_latex(x, con = stdout(), center = TRUE, context = c("rmd", "tex"))

Arguments

x

an object that inherits from stable

...

not used

con

where to write the output

table

if TRUE, the code is wrapped in latex table environment

center

if TRUE, center the table

landscape

if TRUE render the table in landscape mode

caption

the long table description

short

the short table description

float

the float specifier to if a table environment is used; change this to !ht if the float package cannot be loaded for some reason

context

if rmd, then the code is enclosed in a pandoc latex fenced code block; if tex, then the fencing is omitted

asis

if TRUE, the wrapped table is processed with knitr::asis_output() and returned

Examples

if (FALSE) { # \dontrun{
 # this is only needed in an Rmd environment
 library(dplyr)
 stdata() %>% stable() %>% st_asis()
} # }