forked from waddella/rtables_rinpharma2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
04_exercise.R
30 lines (17 loc) · 944 Bytes
/
04_exercise.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Printable-page type exporters (txt, pdf, rtf) support
## pagination specification in exactly the same
## way as direct calls to paginate_table does.
source("02_solution.R")
# Save as txt file, \n>>>>\n page separator
export_as_txt(tbl, file = "./text_output_01.txt", page_type = "a4", font_size = 12, paginate = TRUE,
page_break = "\n>>>>\n")
export_as_txt(tbl, file = "./text_output_02.txt", page_type = "a4", paginate = TRUE,
landscape = TRUE, page_break = "\n>>>>\n")
# Save as pdf (note one pdf with multiple pages)
export_as_pdf(tbl, file = "./pdf_output_01.pdf", page_type = "a4", paginate = TRUE)
export_as_pdf(tbl, file = "./pdf_output_02.pdf", page_type = "a4", paginate = TRUE,
landscape = TRUE)
# Save as RTF
export_as_rtf(tbl, file = "./rtf_output_01.rtf", page_type = "a4")
export_as_rtf(tbl, file = "./rtf_output_02.rtf", page_type = "a4",
landscape = TRUE)