% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calculate_summary_stats_table.R
\name{calculate_summary_stats_table}
\alias{calculate_summary_stats_table}
\title{Calculate Summary Statistics Table}
\usage{
calculate_summary_stats_table(data, output_path = NULL)
}
\arguments{
\item{data}{A data frame containing numeric variables.}

\item{output_path}{Optional. Character string specifying the DOCX output path.
Default is \code{"post_eval_summary.docx"}.}
}
\value{
A \code{flextable} object with formatted summary statistics.
}
\description{
Computes summary statistics (mean, standard deviation, standard error, and quartiles)
for numeric columns of a data frame. Generates a formatted flextable, and saves
both \code{.docx} and \code{.csv} versions of the table.
}
\examples{
if (requireNamespace("DspikeIn", quietly = TRUE)) {
  # --- Phyloseq example ---
  data("physeq", package = "DspikeIn")
  absolute_count <- phyloseq::otu_table(physeq)

  tmp_docx <- file.path(tempdir(), "physeq_summary.docx")
  summary_table_physeq <- calculate_summary_stats_table(
    data = as.data.frame(absolute_count),
    output_path = tmp_docx
  )
  print(summary_table_physeq)
  if (file.exists(tmp_docx)) file.remove(tmp_docx)

  # --- TSE example ---
  data("tse", package = "DspikeIn")
  tse_counts <- SummarizedExperiment::assay(tse)

  tmp_docx2 <- file.path(tempdir(), "tse_summary.docx")
  summary_table_tse <- calculate_summary_stats_table(
    data = as.data.frame(tse_counts),
    output_path = tmp_docx2
  )
  print(summary_table_tse)
  if (file.exists(tmp_docx2)) file.remove(tmp_docx2)
}

}
