% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/analysis_plan.R
\name{render_results}
\alias{render_results}
\title{Render analysis results to a formatted HTML report}
\usage{
render_results(
  results = NULL,
  instrument,
  output_file = NULL,
  output_path = NULL,
  citation_format = c("apa", "ama", "vancouver"),
  title = NULL
)
}
\arguments{
\item{results}{An \code{sframe_analysis_results} object from \code{\link[=run_analysis_plan]{run_analysis_plan()}}.}

\item{instrument}{An \code{sframe} object.}

\item{output_file}{Character or NULL. Path to the output HTML file. When
NULL, a temporary file is written and its path returned.}

\item{output_path}{Character or NULL. Alias for \code{output_file}.}

\item{citation_format}{Character. Reference format. One of \code{"apa"},
\code{"ama"}, or \code{"vancouver"}. Defaults to \code{"apa"}.}

\item{title}{Character or NULL. Report title. Defaults to the instrument
title with " -- Results" appended.}
}
\value{
The output file path, invisibly.
}
\description{
Generates a self-contained HTML report from the output of
\code{\link[=run_analysis_plan]{run_analysis_plan()}}. Each section corresponds to one research question
and includes the APA-formatted statistical result, an interpretation space,
and a reference list.
}
\examples{
instr <- read_sframe(
  system.file("extdata", "tourism_services_demo.sframe",
              package = "surveyframe")
)
responses <- read_responses(
  system.file("extdata", "tourism_services_responses.csv",
              package = "surveyframe"),
  instr,
  respondent_id = "respondent_id",
  submitted_at = "submitted_at",
  meta_cols = "started_at"
)
results <- run_analysis_plan(responses, instr)
out <- render_results(results, instr,
                      output_file = tempfile(fileext = ".html"))
file.exists(out)
}
\seealso{
\code{\link[=run_analysis_plan]{run_analysis_plan()}}, \code{\link[=render_report]{render_report()}}
}
