• R/O
  • SSH

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンdb3f264ed161cbc6a75db74b3dabddec6a54a665 (tree)
日時2022-09-22 19:38:45
作者Lorenzo Isella <lorenzo.isella@gmai...>
コミッターLorenzo Isella

ログメッセージ

I now use the right variable for the scoreboard objectives.

変更サマリ

差分

diff -r 8cb4e420b633 -r db3f264ed161 R-codes/shiny_scoreboard.R
--- a/R-codes/shiny_scoreboard.R Thu Sep 22 10:29:40 2022 +0200
+++ b/R-codes/shiny_scoreboard.R Thu Sep 22 12:38:45 2022 +0200
@@ -165,10 +165,13 @@
165165
166166 df_sc <- df_sc_ini |>
167167 select(member_state, expenditure_year, harmonised_aid_instrument,
168- harmonised_primary_obj, aid_element_eur, case_number,
168+ ## harmonised_primary_obj
169+ scoreboard_objective
170+ , aid_element_eur, case_number,
169171 case_type, co_financing_percentage, covid) |>
170- mutate(harmonised_aid_instrument=remove_trailing_spaces(harmonised_aid_instrument),
171- harmonised_primary_obj=remove_trailing_spaces(harmonised_primary_obj) ) |>
172+ ## mutate(harmonised_aid_instrument=remove_trailing_spaces(harmonised_aid_instrument)## ,
173+ ## ## harmonised_primary_obj=remove_trailing_spaces(harmonised_primary_obj)
174+ ## ) |>
172175 filter(!is.na(aid_element_eur))
173176
174177 instrument <- df_sc |>
@@ -177,7 +180,8 @@
177180 unique()
178181
179182 objective <- df_sc |>
180- pull(harmonised_primary_obj) |>
183+ ## pull(harmonised_primary_obj) |>
184+ pull(scoreboard_objective) |>
181185 sort() |>
182186 unique()
183187
@@ -386,7 +390,8 @@
386390 ## expenditure_year %in% seq(2010,2020),
387391 case_type %in% input$case_type,
388392 harmonised_aid_instrument %in% input$instruments,
389- harmonised_primary_obj %in% input$objectives
393+ ## harmonised_primary_obj
394+ scoreboard_objective %in% input$objectives
390395 )
391396 })
392397
@@ -605,7 +610,7 @@
605610
606611
607612 data_sel() |>
608- group_by(expenditure_year, harmonised_primary_obj ) |>
613+ group_by(expenditure_year, scoreboard_objective ) |>
609614 summarise(exp_mio_eur=sum(aid_element_eur, na.rm=T)) |>
610615 ungroup() |>
611616 mutate(exp_mio_eur=round_preserve_sum(exp_mio_eur,2))
@@ -617,7 +622,7 @@
617622 objective_agg_long <- reactive({
618623
619624 data_sel() |>
620- group_by(harmonised_primary_obj ) |>
625+ group_by(scoreboard_objective ) |>
621626 summarise(exp_mio_eur=sum(aid_element_eur, na.rm=T)) |>
622627 ungroup() |>
623628 mutate(exp_mio_eur=round_preserve_sum(exp_mio_eur,2)) |>
@@ -641,8 +646,8 @@
641646
642647 yearly_objective_agg_long_top <- reactive({
643648 yearly_objective_agg_long() |>
644- mutate(harmonised_primary_obj_top=fct_lump_n(harmonised_primary_obj,k_levels, exp_mio_eur, "All Other Objectives")) |>
645- group_by(expenditure_year, harmonised_primary_obj_top) |>
649+ mutate(scoreboard_objective_top=fct_lump_n(scoreboard_objective,k_levels, exp_mio_eur, "All Other Objectives")) |>
650+ group_by(expenditure_year, scoreboard_objective_top) |>
646651 summarise(exp_mio_eur=sum(exp_mio_eur)) |>
647652 ungroup()
648653
@@ -896,13 +901,13 @@
896901
897902
898903 n_colors <- yearly_objective_agg_long_top() |>
899- pull(harmonised_primary_obj_top) |>
904+ pull(scoreboard_objective_top) |>
900905 unique() |>
901906 length()
902907
903908 fig <- plot_ly(yearly_objective_agg_long_top(),
904909 x = ~expenditure_year, y = ~exp_mio_eur,
905- type = 'bar', color = ~harmonised_primary_obj_top,
910+ type = 'bar', color = ~scoreboard_objective_top,
906911 ## symbol = ~anno,
907912 colors = viridis_pal(option = "H")(n_colors)) %>%
908913 layout(hovermode = "x unified",xaxis = list(title="",
diff -r 8cb4e420b633 -r db3f264ed161 markdown/report_generator_scoreboard.Rmd
--- a/markdown/report_generator_scoreboard.Rmd Thu Sep 22 10:29:40 2022 +0200
+++ b/markdown/report_generator_scoreboard.Rmd Thu Sep 22 12:38:45 2022 +0200
@@ -355,7 +355,7 @@
355355 ft <- objective_agg_long() |>
356356 flextable() |>
357357 ## add_header_row(values = c(paste("State Aid Measures in ", year_focus, sep="")) ) %>%
358- set_header_labels(harmonised_primary_obj="Harmonized Objective",
358+ set_header_labels(scoreboard_objective="Harmonized Objective",
359359 exp_mio_eur="Aid (mio EUR)",
360360 percentage="Percentage of Total Aid",
361361 cumulative_percentage="Cumulative Percentage"
@@ -393,7 +393,7 @@
393393
394394 ggplot(data = yearly_objective_agg_long_top(), aes(x = expenditure_year,
395395 y=exp_mio_eur,
396- fill=harmonised_primary_obj_top)) +
396+ fill=scoreboard_objective_top)) +
397397 geom_bar(position=position_dodge2(preserve="single"), stat="identity", alpha=1, color="black")+
398398 ## scale_fill_viridis("Vehicle Brand\nOrigin",breaks=mybreaks, labels= mylabels, discrete=T)+
399399 ## scale_colour_viridis("Vehicle Brand\nOrigin",breaks=mybreaks, labels= mylabels, discrete=T)+