Initial commit: illustrative R data pipeline
This commit is contained in:
14
scripts/02_validate.R
Normal file
14
scripts/02_validate.R
Normal 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")
|
||||
Reference in New Issue
Block a user