Imports raw data, cleans it, sets up the survey design, computes all indicators, generates publication-ready tables and plots, and optionally renders Word reports.
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
)Path to raw STEPS data file (CSV, Excel, Stata, or SPSS).
Country name for reports (default "Country Name").
Survey year (default 2024).
Minimum age in years (default 18).
Maximum age in years (default 69).
Directory for all outputs (default tempdir()).
Logical; render Word documents? (default TRUE).
Optional path to a filled column mapping template
(Excel or CSV). If provided, uses read_column_mapping() instead of
auto-detection. See the template at
system.file("templates", "column_mapping_template.xlsx",
package = "stepssurvey").
A list with elements:
Original imported data frame
Cleaned and recoded data
Detected column mapping from detect_steps_columns()
survey::svydesign object
List of all computed indicator results by domain
Summary tibble of headline estimates
List of flextable::flextable objects
List of ggplot2::ggplot objects
Configuration list from steps_config()
This is the main entry point for end-to-end STEPS analysis.
if (FALSE) { # \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")
} # }