# NOT RUN {
library(officer)
ft <- flextable(head(mtcars))
# }
# NOT RUN {
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)
fileout <- tempfile(fileext = ".pptx")
# fileout <- "test.pptx" # uncomment to write in your working directory
print(doc, target = fileout)
# }
Run the code above in your browser using DataLab