Writes an RTF file with r2rtf, taking the title, subtitles, footnotes, source line, page orientation and rows-per-page from the shell. Nothing about the rendered output is retyped, so the delivered RTF and the signed-off shell cannot disagree about a footnote.

render_tlf(tbl, shell, path)

Arguments

tbl

An rtables TableTree, normally from build_tlf().

shell

The shell2tlf_shell the table was built from.

path

Output file path, ending in .rtf.

Value

The path, invisibly, with class shell2tlf_render carrying the page and dimension attributes used.

Details

Spanning headers survive the trip: each header line of the rtables table becomes an RTF column header row, with repeated adjacent labels merged into a single spanning cell of the right width.

This replaces the SAS idiom of ODS RTF plus TITLE/FOOTNOTE statements maintained separately from the table program.

Examples

shell <- read_shell(system.file("extdata", "demographics.yaml",
                                package = "shell2tlf"))
adsl <- utils::read.csv(system.file("extdata", "adsl_demo.csv",
                                    package = "shell2tlf"))
tbl <- build_tlf(shell, adsl)
out <- render_tlf(tbl, shell, file.path(tempdir(), "t_14_1_1.rtf"))
out
#> 
#> ── shell2tlf RTF output ────────────────────────────────────────────────────────
#>  Table 14.1.1
#>  /tmp/RtmpnFwGNx/t_14_1_1.rtf
#>  22 body rows x 5 columns | 3 header row(s) | 2 footnote(s)
#>  26 rows per page, portrait