render_tlf.RdWrites 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)An rtables TableTree, normally from build_tlf().
The shell2tlf_shell the table was built from.
Output file path, ending in .rtf.
The path, invisibly, with class shell2tlf_render carrying the page
and dimension attributes used.
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.
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