export_docx | R Documentation |
Export a flextable
object to Microsoft
Word. This function is intended for tables of results from (robust)
mediation analysis. It is essentially a wrapper for
save_as_docx()
with a more convenient argument
for page size, and it uses additional information from subclass
"mediation_flextable"
to determine the page
orientation.
export_docx(object, file, ...)
## S3 method for class 'flextable'
export_docx(object, file, size = c("A4", "letter"), ...)
## Default S3 method:
export_docx(object, file, ...)
object |
an object of class |
file |
a character string specifying the path an file name for the Microsoft Word file to be generated. |
... |
for the |
size |
a character string specifying the page size. Possible values
are |
The function is called for its side effect of creating a Microsoft Word file. It returns the path to the file invisibly.
Andreas Alfons
export_pptx()
flextable()
, to_flextable()
data("BSG2014")
# seed to be used for the random number generator
seed <- 20211117
# perform mediation analysis via robust bootstrap test ROBMED
set.seed(seed)
robust_boot <- test_mediation(BSG2014,
x = "ValueDiversity",
y = "TeamCommitment",
m = "TaskConflict",
robust = TRUE)
# construct flextable of results
ft <- to_flextable(robust_boot)
# export to Microsoft Word
file_name <- tempfile(fileext = ".docx")
export_docx(ft, file = file_name)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.