• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

修订版8cb4e420b633a04c55c5e16c5ff0a7c91c0d191c (tree)
时间2022-09-22 17:29:40
作者Lorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I now write also the original title of the SA cases in one table.

更改概述

差异

diff -r a34946648a70 -r 8cb4e420b633 R-codes/shiny_scoreboard.R
--- a/R-codes/shiny_scoreboard.R Wed Sep 21 18:15:44 2022 +0200
+++ b/R-codes/shiny_scoreboard.R Thu Sep 22 10:29:40 2022 +0200
@@ -154,6 +154,15 @@
154154
155155 df_sc_ini <- readRDS("scoreboard.RDS")
156156
157+
158+sa_titles <- df_sc_ini |>
159+ mutate(case_number_extended=paste(case_number, ": ", original_title,
160+ sep="")) |>
161+ select(case_number, case_number_extended) |>
162+ distinct()
163+
164+
165+
157166 df_sc <- df_sc_ini |>
158167 select(member_state, expenditure_year, harmonised_aid_instrument,
159168 harmonised_primary_obj, aid_element_eur, case_number,
@@ -640,7 +649,6 @@
640649 })
641650
642651
643-
644652 yearly_objective_agg <- reactive({
645653
646654 yearly_objective_agg_long() |>
@@ -685,19 +693,25 @@
685693 casenumber_agg_long <- reactive({
686694
687695
688- data_sel() |>
689- group_by( case_number ) |>
690- summarise(exp_mio_eur=sum(aid_element_eur, na.rm=T)) |>
691- ungroup() |>
692- arrange(desc(exp_mio_eur)) |>
693- mutate(exp_mio_eur=round_preserve_sum(exp_mio_eur,2)) |>
694- mutate(percentage=format_col_preserve_sum(exp_mio_eur/sum(exp_mio_eur)*100,2)) |>
696+ data_sel() |>
697+ ## mutate(case_number=paste(case_number, ": ", original_title,
698+ ## sep="")) |>
699+ group_by( case_number ) |>
700+ summarise(exp_mio_eur=sum(aid_element_eur, na.rm=T)) |>
701+ ungroup() |>
702+ arrange(desc(exp_mio_eur)) |>
703+ mutate(exp_mio_eur=round_preserve_sum(exp_mio_eur,2)) |>
704+ mutate(percentage=format_col_preserve_sum(exp_mio_eur/sum(exp_mio_eur)*100,2)) |>
695705
696- mutate(cumulative_percentage=cumsum(percentage)) |>
697- mutate(cumulative_percentage=format_col_preserve_sum(cumulative_percentage,2) )|>
698- mutate(cumulative_percentage=paste(cumulative_percentage, "%", sep="")) |>
699- mutate(percentage=paste(percentage, "%", sep="")) |>
700- slice(1:k_levels)
706+ mutate(cumulative_percentage=cumsum(percentage)) |>
707+ mutate(cumulative_percentage=format_col_preserve_sum(cumulative_percentage,2) )|>
708+ mutate(cumulative_percentage=paste(cumulative_percentage, "%", sep="")) |>
709+ mutate(percentage=paste(percentage, "%", sep="")) |>
710+ slice(1:k_levels) |>
711+ left_join(y=sa_titles, by=c("case_number")) |>
712+ select(case_number_extended, exp_mio_eur,
713+ percentage, cumulative_percentage) |>
714+ rename("case_number"="case_number_extended")
701715
702716 })
703717
diff -r a34946648a70 -r 8cb4e420b633 markdown/report_generator_scoreboard.Rmd
--- a/markdown/report_generator_scoreboard.Rmd Wed Sep 21 18:15:44 2022 +0200
+++ b/markdown/report_generator_scoreboard.Rmd Thu Sep 22 10:29:40 2022 +0200
@@ -216,8 +216,8 @@
216216 fontsize(part = "all", size = 8) |>
217217 font(part="all", fontname = "Verdana") |>
218218 colformat_double(big.mark = " ") |>
219- FitFlextableToPage()
220-## width(width = c(2,2,2))
219+ ## FitFlextableToPage()
220+ width(width = c(2.5,1.5,1,1))
221221 ft <- add_header_row(
222222 x = ft, values = paste("State Aid by Top Cases along ",input$year_list[1],"-",
223223 input$year_list[2],sep=""),