-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
117 lines (85 loc) · 3.19 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "",
echo = FALSE,
warning = FALSE,
message = FALSE,
fig.retina = 3
)
```
```{r, include = FALSE}
source("_targets_packages.R")
```
```{r, echo = FALSE}
targets::tar_load(syst_all)
targets::tar_load(syst_pocty_long)
targets::tar_load(orgdata_graph)
targets::tar_load(orgdata_nodes_processed)
targets::tar_load(orgdata_edges_processed)
targets::tar_load(orgdata_rect)
```
```{r, include=FALSE}
cnf <- config::get()
nms_orig <- names(cnf)
names(cnf) <- paste0("c_", names(cnf))
list2env(cnf, envir = .GlobalEnv)
names(cnf) <- names(nms_orig)
rm(nms_orig)
```
# systemizace
<!-- badges: start -->
<!-- badges: end -->
This repository contains R code to download and process official data on the organisation of public servants in the Czech central public administration - "systemizace služebních míst".
It works with two sources of data:
1. The official tables
2. Organisational structures published as [open data](https://data.gov.cz/datov%C3%A1-sada?iri=https%3A%2F%2Fdata.gov.cz%2Fzdroj%2Fdatov%C3%A9-sady%2F00007064%2F846439662)
### Official tables
The code downloads, loads and processes the published excel files such that
- the data is in tidy format
- civil servants and employees are in one data frame
- pay grades (platové třídy) and management levels (představení) are correctly identified
See https://www.mvcr.cz/sluzba/clanek/systemizace-sluzebnich-a-pracovnich-mist.aspx. For [April 2022 edition](https://www.mvcr.cz/sluzba/clanek/zmena-systemizace-sluzebnich-a-pracovnich-mist-s-ucinnosti-od-1-dubna-2022.aspx), only PDF table is provided.
Data currently available from `r min(syst_all$rok)` to `r max(syst_all$rok)`.
#### Sample
```{r}
syst_pocty_long |>
dplyr::filter(ustredni_organ, kapitola_vladni) |>
mutate(trida = as.integer(trida)) |>
group_by(rok, kapitola_zkr, level_nazev) |>
drop_na(pocet) |>
dplyr::filter(date == "2022-04-01") |>
summarise(trida_mean = weighted.mean(trida, w = pocet, na.rm = TRUE),
.groups = "drop") |>
mutate(kapitola_zkr = as.factor(kapitola_zkr) |> fct_reorder(trida_mean, min)) |>
ggplot(aes(trida_mean, kapitola_zkr, colour = level_nazev)) +
geom_point(size = 3) +
scale_color_manual(name = "Úroveň řízení", values = c("grey50", "darkblue")) +
scale_x_continuous(limits = c(10, 15)) +
ptrr::theme_ptrr("both", multiplot = FALSE, legend.position = "top") +
labs(title = "Průměrná platová třída (2022)",
subtitle = "Podle systemizace 2022.\nJen ústřední orgány ve vládních kapitolách",
caption = "Plánovaný stav podle systemizace 2022")
```
Wide format
```{r}
syst_all
```
Long format - staff numbers only
```{r}
syst_pocty_long
```
### Organisational structures
These are now in a [separate repository](https://github.com/petrbouchal/mapa-statu/).
### Technical: how to run this
Code organised as a {targets} pipeline, with packages tracked by {renv}, so can be reproduced like so:
```r
renv::restore()
targets::tar_make()
```
Tidy data ready for analysis are in `data-export`. Codebook is TBA.
Rendered `r Sys.time()`