The PDF output is based on the ASCII output created with toString
export_as_pdf(
tt,
file,
page_type = "letter",
landscape = FALSE,
pg_width = page_dim(page_type)[if (landscape) 2 else 1],
pg_height = page_dim(page_type)[if (landscape) 1 else 2],
width = NULL,
height = NULL,
margins = c(4, 4, 4, 4),
font_family = "Courier",
fontsize = 8,
font_size = fontsize,
paginate = TRUE,
lpp = NULL,
cpp = NULL,
hsep = "-",
indent_size = 2,
tf_wrap = TRUE,
max_width = NULL,
colwidths = propose_column_widths(matrix_form(tt, TRUE)),
...
)
TableTree (or related class). A TableTree object representing a populated table.
file to write, must have .pdf
extension
character(1). Name of a page type. See
page_types
. Ignored when pg_width
and pg_height
are set directly.
logical(1). Should the dimensions of page_type
be inverted for landscape? Defaults to FALSE
, ignored when
pg_width
and pg_height
are set directly.
numeric(1). Page width in inches.
numeric(1). Page height in inches.
Deprecated, please use pg_width
or specify
page_type
. The width of the graphics region in inches
Deprecated, please use pg_height
or specify
page_type
. The height of the graphics region in
inches
numeric(4). The number of lines/characters of margin on the bottom, left, top, and right sides of the page.
character(1). Name of a font family. An error will be thrown if the family named is not monospaced. Defaults to Courier.
Deprecated, please use font_size
. the size of
text (in points)
numeric(1). Font size, defaults to 12.
logical(1). Should tt
be paginated before writing the file. Defaults to TRUE
if any sort of page dimension is specified.
numeric. Maximum lines per page including (re)printed header and context rows
numeric(1) or NULL. Width (in characters) of the pages for
horizontal pagination. NULL
(the default) indicates no horizontal
pagination should be done.
character(1). Set of character(s) to be repeated as the separator
between the header and body of the table when rendered as text. Defaults to
a connected horizontal line (unicode 2014) in locals that use a UTF
charset, and to -
elsewhere (with a once per session warning).
numeric(1). Number of spaces to use per indent level. Defaults to 2
logical(1). Should the texts for title, subtitle, and footnotes be wrapped?
integer(1), character(1) or NULL. Width that title
and footer (including footnotes) materials should be
word-wrapped to. If NULL, it is set to the current print width
of the session (getOption("width")
). If set to "auto"
,
the width of the table (plus any table inset) is used. Ignored
completely if tf_wrap
is FALSE
.
numeric vector. Column widths for use with vertical pagination.
arguments passed on to paginate_table
By default, pagination is performed, with default
cpp
and lpp
defined by specified page dimensions and margins.
User-specified lpp
and cpp
values override this, and should
be used with caution.
Title and footer materials are also word-wrapped by default
(unlike when printed to the terminal), with cpp
, as
defined above, as the default max_width
.
export_as_txt()
lyt <- basic_table() %>%
split_cols_by("ARM") %>%
analyze(c("AGE", "BMRKR2", "COUNTRY"))
tbl <- build_table(lyt, ex_adsl)
if (FALSE) {
tf <- tempfile(fileext = ".pdf")
export_as_pdf(tbl, file = tf, pg_height = 4)
tf <- tempfile(fileext = ".pdf")
export_as_pdf(tbl, file = tf, lpp = 8)
}
Run the code above in your browser using DataLab