% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pipeline.R
\name{run_steps_pipeline}
\alias{run_steps_pipeline}
\title{Run the complete STEPS analysis pipeline}
\usage{
run_steps_pipeline(
  data_path,
  country_name = "Country Name",
  survey_year = 2024,
  age_min = 18,
  age_max = 69,
  output_dir = tempdir(),
  render_reports = TRUE,
  mapping_file = NULL
)
}
\arguments{
\item{data_path}{Path to raw STEPS data file (CSV, Excel, Stata, or SPSS).}

\item{country_name}{Country name for reports (default "Country Name").}

\item{survey_year}{Survey year (default 2024).}

\item{age_min}{Minimum age in years (default 18).}

\item{age_max}{Maximum age in years (default 69).}

\item{output_dir}{Directory for all outputs (default \code{tempdir()}).}

\item{render_reports}{Logical; render Word documents? (default TRUE).}

\item{mapping_file}{Optional path to a filled column mapping template
(Excel or CSV). If provided, uses \code{\link[=read_column_mapping]{read_column_mapping()}} instead of
auto-detection. See the template at
\code{system.file("templates", "column_mapping_template.xlsx",
  package = "stepssurvey")}.}
}
\value{
A list with elements:
\describe{
\item{raw_data}{Original imported data frame}
\item{clean_data}{Cleaned and recoded data}
\item{cols}{Detected column mapping from \code{\link[=detect_steps_columns]{detect_steps_columns()}}}
\item{design}{\link[survey:svydesign]{survey::svydesign} object}
\item{indicators}{List of all computed indicator results by domain}
\item{key_indicators}{Summary tibble of headline estimates}
\item{tables}{List of \link[flextable:flextable]{flextable::flextable} objects}
\item{plots}{List of \link[ggplot2:ggplot]{ggplot2::ggplot} objects}
\item{config}{Configuration list from \code{\link[=steps_config]{steps_config()}}}
}
}
\description{
Imports raw data, cleans it, sets up the survey design, computes
all indicators, generates publication-ready tables and plots, and
optionally renders Word reports.
}
\details{
This is the main entry point for end-to-end STEPS analysis.
}
\examples{
\dontrun{
# Auto-detect columns
result <- run_steps_pipeline("data/raw/steps_data.csv",
                             country_name = "Senegal",
                             survey_year = 2023)
result$key_indicators
result$plots$overview

# Use a custom column mapping
result <- run_steps_pipeline("data/raw/steps_data.csv",
                             country_name = "Senegal",
                             survey_year = 2023,
                             mapping_file = "my_mapping.xlsx")
}
}
