ph_with_table {officer} | R Documentation |
add a table as a new shape in the current slide.
This function will be deprecated in favor of ph_with
in the next release.
ph_with_table(x, value, type = "body", index = 1, header = TRUE, first_row = TRUE, first_column = FALSE, last_row = FALSE, last_column = FALSE, location = NULL) ph_with_table_at(x, value, left, top, width, height, header = TRUE, first_row = TRUE, first_column = FALSE, last_row = FALSE, last_column = FALSE)
x |
a pptx device |
value |
data.frame |
type |
placeholder type (i.e. 'body', 'title') |
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', the first
one will be added with index 1 and the second one with index 2.
It is recommanded to use argument |
header |
display header if TRUE |
first_row, last_row, first_column, last_column |
logical for PowerPoint table options |
location |
a placeholder location object. This is a convenient
argument that can replace usage of arguments |
left, top |
location of the new shape on the slide |
width, height |
shape size in inches |
library(magrittr) doc <- read_pptx() %>% add_slide(layout = "Title and Content", master = "Office Theme") %>% ph_with_table(value = mtcars[1:6,], type = "body", last_row = FALSE, last_column = FALSE, first_row = TRUE) print(doc, target = tempfile(fileext = ".pptx")) library(magrittr) doc <- read_pptx() %>% add_slide(layout = "Title and Content", master = "Office Theme") %>% ph_with_table_at(value = mtcars[1:6,], height = 4, width = 8, left = 4, top = 4, last_row = FALSE, last_column = FALSE, first_row = TRUE) print(doc, target = tempfile(fileext = ".pptx"))