% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/export_to_word.R
\name{export_to_word}
\alias{export_to_word}
\title{Export an EasyStat Result to a Formatted Microsoft Word Document}
\usage{
export_to_word(result, file, title = NULL, author = "EasyStat")
}
\arguments{
\item{result}{An object of class \code{"easystat_result"} as returned by
\code{\link{easy_regression}}, \code{\link{easy_logistic_regression}},
\code{\link{easy_ttest}}, or \code{\link{easy_anova}}.}

\item{file}{Character string. Path to the output \code{.docx} file.
Must be provided by the caller; for example, use
\code{tempfile(fileext = ".docx")} for a temporary file.}

\item{title}{Character string. Report title printed at the top of the
document. If \code{NULL} (default) a title is auto-generated from the
test type.}

\item{author}{Character string. Author name(s) for the report header.
Default \code{"EasyStat"}.}
}
\value{
The \code{file} path invisibly (a length-one character vector). The
  \code{.docx} file is written to the path supplied via \code{file} as a
  side-effect.
}
\description{
Takes a unified \code{easystat_result} object and writes a fully formatted
\code{.docx} report using the \code{flextable} and \code{officer} packages.
The report contains a title page header, the plain-language narrative,
both statistical tables rendered as professional \code{flextable} objects,
and a footer with metadata. All of this is produced in a single function call.
}
\examples{
\donttest{
  result <- easy_regression(mpg ~ wt + hp, data = mtcars)
  export_to_word(result, file = tempfile(fileext = ".docx"),
                author = "Mr. Mahesh Divakaran")
}

}
