# created in 5_budget-balance.R
obce_bilance <- read_parquet("data-processed/budgets_bilance.parquet")
source("shared.R")
## ℹ Codelist file already in 'data-input/sp/', not downloading. Set `redownload = TRUE` if needed.
## ℹ Processing codelist data
## ℹ Codelist file already in 'data-input/sp/', not downloading. Set `redownload = TRUE` if needed.
## ℹ Processing codelist data
obce_bilance
per_yr <chr> | ico <chr> | katobyv_nazev <fctr> | katobyv_id <chr> | nuts_id <chr> | |
|---|---|---|---|---|---|
| 2010 | 00035513 | 201 až 500 | 3 | CZ0522 | |
| 2010 | 00038113 | 1 001 až 2 000 | 5 | CZ0534 | |
| 2010 | 00038130 | 1 001 až 2 000 | 5 | CZ0533 | |
| 2010 | 00042188 | 501 až 1 000 | 4 | CZ0644 | |
| 2010 | 00064581 | nad 1 000 000 | 12 | CZ0100 | |
| 2010 | 00075370 | 100 001 až 1 000 000 | 11 | CZ0323 | |
| 2010 | 00075566 | 0 až 100 | 1 | CZ0422 | |
| 2010 | 00081531 | 50 001 až 100 000 | 10 | CZ0427 | |
| 2010 | 00084409 | 501 až 1 000 | 4 | CZ0635 | |
| 2010 | 00104051 | 201 až 500 | 3 | CZ0647 |
rnd_obec <- sample(ico_obce, size = 1)
rnd_obec
## [1] "00266493"
obce_bilance[obce_bilance$ico == rnd_obec,]
per_yr <chr> | ico <chr> | katobyv_nazev <fctr> | katobyv_id <chr> | nuts_id <chr> | orgs_ucjed_nazev <chr> | obec <chr> | pocob <chr> | |
|---|---|---|---|---|---|---|---|---|
| 2010 | 00266493 | 501 až 1 000 | 4 | CZ0426 | Obec Modlany | Modlany | 918 | |
| 2011 | 00266493 | 501 až 1 000 | 4 | CZ0426 | Obec Modlany | Modlany | 918 | |
| 2012 | 00266493 | 501 až 1 000 | 4 | CZ0426 | Obec Modlany | Modlany | 953 | |
| 2013 | 00266493 | 501 až 1 000 | 4 | CZ0426 | Obec Modlany | Modlany | 987 | |
| 2014 | 00266493 | 501 až 1 000 | 4 | CZ0426 | Obec Modlany | Modlany | 996 | |
| 2015 | 00266493 | 1 001 až 2 000 | 5 | CZ0426 | Obec Modlany | Modlany | 1033 | |
| 2016 | 00266493 | 1 001 až 2 000 | 5 | CZ0426 | Obec Modlany | Modlany | 1046 | |
| 2017 | 00266493 | 1 001 až 2 000 | 5 | CZ0426 | Obec Modlany | Modlany | 1046 | |
| 2018 | 00266493 | 1 001 až 2 000 | 5 | CZ0426 | Obec Modlany | Modlany | 1060 | |
| 2019 | 00266493 | 1 001 až 2 000 | 5 | CZ0426 | Obec Modlany | Modlany | 1060 |
obce_bilance %>%
ggplot(aes(as.numeric(per_yr), bilance_rel, group = per_yr)) +
geom_boxplot(alpha = .1) +
facet_wrap(~ katobyv_nazev) +
scale_y_continuous(limits = c(-1,1)) +
ptrr::theme_ptrr("y", multiplot = T) +
scale_x_continuous(breaks = seq(2010, 2019, 3))
## Warning: Removed 625 rows containing non-finite values (stat_boxplot).

write_parquet(obce_bilance, "data-processed/budgets_bilance.parquet")