Learn R Programming

rtables (version 0.5.1)

export_as_txt: Export as plain text with page break symbol

Description

Export as plain text with page break symbol

Usage

export_as_txt(
  tt,
  file = NULL,
  paginate = FALSE,
  ...,
  page_break = "\\s\\n",
  hsep = default_hsep(),
  indent_size = 2
)

Value

file (this function is called for the side effect of writing the file.

Arguments

tt

TableTree (or related class). A TableTree object representing a populated table.

file

character(1). File to write.

paginate

logical(1). Should tt be paginated before writing the file.

...

Passed directly to paginate_table

page_break

character(1). Page break symbol (defaults to outputting "\s").

hsep

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 horrizontal line (unicode 2014) in locals that use a UTF charset, and to - elsewhere (with a once per session warning).

indent_size

numeric(1). Number of spaces to use per indent level. Defaults to 2

See Also

export_as_pdf

Examples

Run this code

lyt <- basic_table() %>%
  split_cols_by("ARM") %>%
  analyze(c("AGE", "BMRKR2", "COUNTRY"))

tbl <- build_table(lyt, ex_adsl)

cat(export_as_txt(tbl, file = NULL, paginate = TRUE, lpp = 8))

if (FALSE) {
tf <- tempfile(fileext = ".txt")
export_as_txt(tbl, file = tf)
system2("cat", tf)
}

Run the code above in your browser using DataLab