-
Notifications
You must be signed in to change notification settings - Fork 0
/
check-data.qmd
51 lines (43 loc) · 1.13 KB
/
check-data.qmd
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
---
title: "Check sources"
format: html
editor: source
---
```{r}
library(dplyr)
library(readr)
library(tinyplot)
options(scipen = 99)
```
```{r}
szu <- read_rds("data-interim/szu-uo-all-do2023.rds")
sp <- read_rds("data-interim/sp_platy_uo.rds")
```
```{r}
szu_s <- szu |>
filter(rok == 2022, faze_rozpoctu == "SKUT") |>
select(kap_zkr, kap_kod, platy_szu = platy, pocet_zamestnancu, rok)
```
```{r}
sp_s <- sp |>
filter(rok == 2022, promenna %in% c("platy")) |>
select(kap_kod, platy_sp = skut, rok)
```
```{r}
both <- left_join(szu_s, sp_s, by = join_by(kap_kod, rok)) |>
mutate(rozdil = round(platy_szu - platy_sp),
across(starts_with("platy"), \(x) x/1e6))
both
```
```{r}
op = tpar(
bty = "n", # No box (frame) around the plot
family = "IBM Plex Sans", # Use R's Hershey font instead of Arial default
grid = TRUE, # Add a background grid
las = 1, # Horizontal axis tick labels
pch = 16 # Filled points as default
)
tinyplot(platy_szu ~ platy_sp | kap_zkr, data = both,
palette = "dark", pch = 16,
grid = TRUE, frame = FALSE)
```