Revision | 070e732ad5e251f723dc929976489d88cee545dc (tree) |
---|---|
Time | 2025-01-10 06:15:47 |
Author | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
I added other stats.
@@ -26,4 +26,42 @@ | ||
26 | 26 | save_excel(df_out, "../output/tctf_tax_advantage.xlsx") |
27 | 27 | |
28 | 28 | |
29 | +df_out2 <- df_ini |> | |
30 | + filter(ukraine==T, | |
31 | + harmonised_aid_instrument=="Tax advantage") |> | |
32 | + summarise(expenditure_mio_eur=sum(aid_element_eur, na.rm=T), | |
33 | + .by=c(member_state_2_letter_codes, expenditure_year, | |
34 | + harmonised_aid_instrument,case_number)) | |
35 | + | |
36 | + | |
37 | + | |
38 | +df_legal_ini <- read_csv("../input/All_tables_and_summary_17.12.2024.csv") |> | |
39 | + clean_names() | |
40 | + | |
41 | +df_legal <- df_legal_ini |> | |
42 | + select(case_number, type_of_measure) | |
43 | + | |
44 | + | |
45 | +df_out3 <- df_out2 |> | |
46 | + left_join(df_legal, by=c("case_number")) | |
47 | + | |
48 | + | |
49 | + | |
50 | +df_out4 <- df_out3 |> | |
51 | + summarise(total_expenditure_mio_eur=sum(expenditure_mio_eur), | |
52 | + .by=c(expenditure_year, | |
53 | + harmonised_aid_instrument, | |
54 | + member_state_2_letter_codes, | |
55 | + type_of_measure | |
56 | + )) |> | |
57 | + rename("expenditure_mio_eur"="total_expenditure_mio_eur") |> | |
58 | + mutate(expenditure_mio_eur=round_preserve_sum(expenditure_mio_eur,2), | |
59 | + .by=c(member_state_2_letter_codes, expenditure_year)) |> | |
60 | + make_wide_with_total("expenditure_year" ,"expenditure_mio_eur") | |
61 | + | |
62 | +save_excel(df_out4, "../output/tctf_tax_advantage_article.xlsx") | |
63 | + | |
64 | + | |
65 | + | |
66 | + | |
29 | 67 | print("So far so good") |