Insert a FlexTable into a document object
FlexTable can be manipulated so that almost any formatting can be specified. See
FlexTable
for more details.
addFlexTable(doc, flextable, ...) # S3 method for docx addFlexTable(doc, flextable, par.properties = parProperties(text.align = "left"), bookmark, ...) # S3 method for pptx addFlexTable(doc, flextable, offx, offy, width, height, ...)
doc | document object |
---|---|
flextable | the |
... | further arguments passed to other methods |
par.properties | paragraph formatting properties of the paragraph that contains the table.
An object of class |
bookmark | a character vector specifying bookmark id (where to put the table). If provided, table will be add after paragraph that contains the bookmark. If not provided, table will be added at the end of the document. |
offx | optional, x position of the shape (top left position of the bounding box) in inches. See details. |
offy | optional, y position of the shape (top left position of the bounding box) in inches. See details. |
width | optional, width of the shape in inches. See details. |
height | optional, height of the shape in inches. See details. |
a document object
When document is a pptx
object, two positioning methods are available.
If arguments offx, offy, width, height are missing, position and dimensions
will be defined by the width and height of the next available shape of the slide. This
dimensions can be defined in the layout of the PowerPoint template used to create
the pptx
object.
If arguments offx, offy, width, height are provided, they become position and dimensions of the new shape.
options( "ReporteRs-fontsize" = 11 )# docx example ----- doc = docx( ) doc = addFlexTable( doc, flextable = ft_obj ) writeDoc( doc, file = "add_ft_ex.docx" )# pptx example ----- doc = pptx( ) doc = addSlide( doc, slide.layout = "Title and Content" ) doc = addFlexTable( doc, flextable = ft_obj ) writeDoc( doc, file = "add_ft_ex.pptx" )