R: add flextable into a PowerPoint slide

ph_with_flextable {flextable} | R Documentation

## add flextable into a PowerPoint slide

### Description

add a flextable as a new shape in the current slide.

### Usage

    ph_with_flextable(x, value, type = "body", index = 1)

    ph_with_flextable_at(x, value, left, top)

### Arguments

`x` | an rpptx device
`value` | `flextable` object
`type` | placeholder type
`index` | placeholder index (integer). This is to be used when a placeholder type is not unique in the current slide, e.g. two placeholders with type 'body'.
`left, top` | location of flextable on the slide in inches

### Note

The width and height of the table can not be set with this function. Use functions `width`, `height`, `autofit` and `dim_pretty` instead. The overall size is resulting from cells, paragraphs and text properties (i.e. padding, font size, border widths).

### Examples

    library(officer)
    ft <- flextable(head(mtcars))

    doc <- read_pptx()
    doc <- add_slide(doc, layout = "Title and Content",
                     master = "Office Theme")
    doc <- ph_with_flextable(doc, value = ft, type = "body")
    doc <- ph_with_flextable_at(doc, value = ft, left = 4, top = 5)
    print(doc, target = "test.pptx" )

[Package flextable version 0.4.5 Index]