tf <- tempfile(fileext = ".rtf")
library(officer)
ft1 <- flextable(head(iris))
save_as_rtf(ft1, path = tf)
ft2 <- flextable(head(mtcars))
sect_properties <- prop_section(
page_size = page_size(
orient = "landscape",
width = 8.3, height = 11.7
),
type = "continuous",
page_margins = page_mar(),
header_default = block_list(
fpar(ftext("text for default page header")),
qflextable(data.frame(a = 1L)))
)
tf <- tempfile(fileext = ".rtf")
save_as_rtf(
`iris table` = ft1, `mtcars table` = ft2,
path = tf, pr_section = sect_properties
)
Run the code above in your browser using DataLab