export-pivot | R Documentation |
Export formated pivot table to PowerPoint, Word or Excel document.
export(x, output, to = c("pptx", "docx", "xlsx"), ...)
export_pptx(x, output, ...)
export_docx(x, output, ...)
export_xlsx(x, output, label_value = "value", ...)
x |
A |
output |
Path where to generate file. |
to |
Output document: |
... |
Arguments passed to |
label_value |
For Excel output, the label for variable containing the values. |
Path to output (invisibly).
library(flexpivot)
data("nobel_laureates")
pt <- pivot_table(nobel_laureates, rows = "category", cols = "gender")
# To PowerPoint
path_pptx <- tempfile(fileext = ".pptx")
export_pptx(pt, path_pptx)
browseURL(path_pptx)
# To Word
path_docx <- tempfile(fileext = ".docx")
export_docx(pt, path_docx)
browseURL(path_docx)
# To Excel
path_xlsx <- tempfile(fileext = ".xlsx")
export_xlsx(pt, path_xlsx)
browseURL(path_xlsx)
# Clean up
unlink(path_pptx)
unlink(path_docx)
unlink(path_xlsx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.