Make a terrain table in a text document

I use the ReporteRs package in R to create a report. I have a table that has 13 columns, and I would like it to go in landscape orientation. Otherwise, some columns will be cut from the table. I am wondering if this can be specified in ReporteR for a specific FlexTable object? All other tables and texts are presented in portrait format. I apologize for not giving a reproducible example. Thank you in advance.

+6
source share
1 answer

You can do this with addSection :

 library(ReporteRs) doc = docx() doc = addSection( doc, landscape = T ) doc = addFlexTable( doc, FlexTable( mtcars) ) doc = addSection( doc, landscape = F ) writeDoc( doc, "test.docx") 

Another solution would be to create an empty Word document with landscape orientation and then use it as a template:

 library(ReporteRs) doc = docx(template = "your_landscape_doc.docx") doc = addFlexTable( doc, FlexTable( mtcars) ) writeDoc( doc, "test.docx") 
+4
source

Source: https://habr.com/ru/post/981815/


All Articles