25 lines
809 B
R
25 lines
809 B
R
# 01_create_data.R
|
|
# Creates two wide-format CSV files: income (euros) and population.
|
|
# Wide format mirrors how accountants typically lay out data in Excel —
|
|
# one row per entity, months as columns.
|
|
|
|
source("scripts/00_paths.R")
|
|
|
|
library(tibble)
|
|
library(readr)
|
|
|
|
df_income <- tribble(
|
|
~id, ~category, ~denomination, ~jan, ~feb, ~mar, ~apr, ~may, ~jun,
|
|
1, "income", "euro", 42000000, 39500000, 44200000, 41800000, 43100000, 40600000
|
|
)
|
|
|
|
df_population <- tribble(
|
|
~state, ~category, ~unit, ~jan, ~feb, ~mar, ~apr, ~may, ~jun,
|
|
"FL", "population", "thousands", 22600, 22600, 22650, 22650, 22700, 22700
|
|
)
|
|
|
|
write_csv(df_income, income_raw)
|
|
write_csv(df_population, population_raw)
|
|
|
|
cat("01_create_data.R: wrote df_income.csv and df_population.csv\n")
|