Initial commit: illustrative R data pipeline

This commit is contained in:
2026-03-09 14:20:10 -04:00
commit 83e50d2c36
12 changed files with 277 additions and 0 deletions

14
scripts/02_validate.R Normal file
View File

@@ -0,0 +1,14 @@
# 02_validate.R
# Validates raw input files. Stops the pipeline if data doesn't look right.
source("scripts/00_paths.R")
library(readr)
df_income <- read_csv(income_raw, show_col_types = FALSE)
df_population <- read_csv(population_raw, show_col_types = FALSE)
stopifnot("df_income has wrong number of columns" = ncol(df_income) == input_cols)
stopifnot("df_population has wrong number of columns" = ncol(df_population) == input_cols)
cat("02_validate.R: input data looks good\n")