Export an EasyStat Result to a Formatted Microsoft Word Document
Source:R/export_to_word.R
export_to_word.RdTakes a unified easystat_result object and writes a fully formatted
.docx report using the flextable and officer packages.
The report contains a title page header, the plain-language narrative,
both statistical tables rendered as professional flextable objects,
and a footer with metadata. All of this is produced in a single function call.
Arguments
- result
An object of class
"easystat_result"as returned byeasy_regression,easy_logistic_regression,easy_ttest, oreasy_anova.- file
Character string. Path to the output
.docxfile. Defaults to"EasyStat_Report.docx"in the current working directory.- title
Character string. Report title printed at the top of the document. If
NULL(default) a title is auto-generated from the test type.Character string. Author name(s) for the report header. Default
"EasyStat".
Examples
if (FALSE) { # \dontrun{
result <- easy_regression(mpg ~ wt + hp, data = mtcars)
export_to_word(result, file = tempfile(fileext = ".docx"),
author = "Mr. Mahesh Divakaran")
} # }