• 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

修订版1e69df1f55a34375b1dc93b1c0620631f938ffe9 (tree)
时间2022-09-21 17:17:20
作者Lorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I improved the report.

更改概述

差异

diff -r 4fb23bf35604 -r 1e69df1f55a3 markdown/report_generator_scoreboard.Rmd
--- a/markdown/report_generator_scoreboard.Rmd Tue Sep 20 21:51:26 2022 +0200
+++ b/markdown/report_generator_scoreboard.Rmd Wed Sep 21 10:17:20 2022 +0200
@@ -1,5 +1,5 @@
11 ---
2-title: "Report"
2+title: "State Aid Report for `r input$countries`"
33 output: word_document
44 ---
55
@@ -71,6 +71,17 @@
7171 <!-- params$ms -->
7272 <!-- ``` -->
7373
74+# Short Methodological Note
75+This report is generated according to the filters applied in the web
76+app. Whenever "total aid" is mentioned, that has to be interpreted as
77+a shorthand for
78+"total aid based on the filters applied to the data for the chosen
79+Member State". The same considerations apply to expression like
80+e.g. "top State Aid cases", which are always meant to be as the top
81+State Aid cases for the dataset filtered by the user.
82+
83+
84+# Overview of the Yearly State Aid Expenditure
7485
7586 Following the filters applied to the data,
7687 for the years from `r input$year_list[1]` to
@@ -79,7 +90,7 @@
7990 `r year_max_expenditure()$expenditure_year` with an expenditure of
8091 `r year_max_expenditure()$exp_mio_eur` million EUR amounting to
8192 `r year_max_expenditure()$percentage` of the total aid in the period
82-under scrutiny. The evolution of the aid along
93+under scrutiny. The evolution of the aid along
8394 `r input$year_list[1]`-`r input$year_list[2]` is illustrated below.
8495
8596
@@ -99,8 +110,10 @@
99110 guides(fill=guide_legend(nrow=2,byrow=TRUE))
100111 ```
101112
113+# State Aid Expenditure and Type of Aid
114+
102115 In the table below we give a breakdown of the total aid by type of
103-case along the specified time period.
116+case along the specified time period.
104117
105118
106119 ```{r, table1, echo=FALSE, eval=TRUE}
@@ -118,7 +131,7 @@
118131 autofit()
119132 ## width(width = c(2,2,2))
120133 ft <- add_header_row(
121- x = ft, values = paste("State Aid by Case Type ",input$year_list[1],"-",
134+ x = ft, values = paste("State Aid by Case Type along ",input$year_list[1],"-",
122135 input$year_list[2],sep=""),
123136 colwidths = c(3))
124137 ft <- theme_box(ft) %>%
@@ -126,9 +139,11 @@
126139 align(align = "right",j=c(2,3), part="body")
127140 ft
128141 ```
129-Furthermore, in the Figure below, we illustrate the evolutation of the
142+
143+
144+Beside giving the aggregated values, we illustrate the evolution of the
130145 expenditure by case type on a yearly basis for the period
131-`r input$year_list[1]`-`r input$year_list[2]`.
146+`r input$year_list[1]`-`r input$year_list[2]` in the Figure below.
132147
133148
134149 ```{r, echo=FALSE,fig.height = 6, fig.width = 12}
@@ -170,8 +185,11 @@
170185 guides(fill=guide_legend(nrow=2,byrow=TRUE))
171186 ```
172187
173-In the table below, we point out the contribution of the top State Aid
174-cases to the total aid given in `r input$year_list[1]`-`r input$year_list[2]`.
188+# Contribution from Top State Aid Cases
189+
190+In the table below, we point out the contribution of the top
191+`r k_levels` State Aid
192+cases to the total aid given along `r input$year_list[1]`-`r input$year_list[2]`.
175193
176194 ```{r, table2, echo=FALSE, eval=TRUE}
177195 ft <- casenumber_agg_long() |>
@@ -188,7 +206,7 @@
188206 autofit()
189207 ## width(width = c(2,2,2))
190208 ft <- add_header_row(
191- x = ft, values = paste("State Aid by Top Cases ",input$year_list[1],"-",
209+ x = ft, values = paste("State Aid by Top Cases along ",input$year_list[1],"-",
192210 input$year_list[2],sep=""),
193211 colwidths = c(3))
194212 ft <- theme_box(ft) %>%
@@ -197,7 +215,7 @@
197215 ft
198216 ```
199217
200-Their yearly contribution is shown in the Figure below.
218+We illustrate their yearly contribution in the Figure below.
201219
202220
203221 ```{r, echo=FALSE,fig.height = 6, fig.width = 12}
@@ -239,6 +257,10 @@
239257 guides(fill=guide_legend(nrow=2,byrow=TRUE))
240258 ```
241259
260+# Main Instruments for State Aid
261+
262+In the table below we show the contribution from the top `r k_levels`
263+harmonized instruments to the total aid given along `r input$year_list[1]`-`r input$year_list[2]`.
242264
243265
244266 ```{r, table3, echo=FALSE, eval=TRUE}
@@ -256,7 +278,7 @@
256278 autofit()
257279 ## width(width = c(2,2,2))
258280 ft <- add_header_row(
259- x = ft, values = paste("State Aid by Top Harmonized Instruments ",input$year_list[1],"-",
281+ x = ft, values = paste("State Aid by Top Harmonized Instruments along ",input$year_list[1],"-",
260282 input$year_list[2],sep=""),
261283 colwidths = c(3))
262284 ft <- theme_box(ft) %>%
@@ -265,7 +287,55 @@
265287 ft
266288 ```
267289
268-We now consider
290+We also illustrate the yearly evolution of the contribution from the
291+aforementioned instruments in the Figure below.
292+
293+
294+
295+```{r, echo=FALSE,fig.height = 6, fig.width = 12}
296+
297+
298+## my_pal <- viridis(length(stat_cases2 %>% pull(procedure_name) %>%
299+## unique)+1)[1:4]
300+
301+
302+
303+my_pal <- pal_npg("nrc")(k_levels+1)
304+
305+ggplot(data = yearly_instrument_agg_long_top(), aes(x = expenditure_year,
306+ y=exp_mio_eur,
307+ fill=harmonised_aid_instrument_top)) +
308+ geom_bar(position=position_dodge2(preserve="single"), stat="identity", alpha=1, color="black")+
309+ ## scale_fill_viridis("Vehicle Brand\nOrigin",breaks=mybreaks, labels= mylabels, discrete=T)+
310+ ## scale_colour_viridis("Vehicle Brand\nOrigin",breaks=mybreaks, labels= mylabels, discrete=T)+
311+
312+ scale_fill_manual(NULL, ## labels=c("Inward Stocks","Outward Stocks" ),
313+ values=my_pal)+
314+
315+
316+ ## coord_cartesian(ylim = c(0, 20)) +
317+ my_ggplot_theme2("top")+
318+## theme(axis.text.x = element_text(size=15,angle=90, colour="black", vjust=1))+
319+
320+ labs(title=paste("State Aid Spending in Million EUR ",input$year_list[1], "-",
321+ input$year_list[2], sep=""))+
322+ scale_x_continuous(breaks=seq(input$year_list[1], input$year_list[2]))+
323+## coord_cartesian(ylim=c(0,8000))+
324+## scale_y_continuous(sec.axis = sec_axis(~./norm_in, labels=mypercentlatex,
325+## name="Percentage of\nTotal Extra EU28",
326+## breaks=seq(0, 1, by=0.2)))+
327+## scale_y_continuous(labels=mypercentlatex)+
328+
329+ xlab("Year")+
330+ ylab("State Aid Expenditure")+
331+ guides(fill=guide_legend(nrow=2,byrow=TRUE))
332+```
333+
334+
335+# Main Objectives of State Aid Expenditure
336+
337+In the table below we show the contribution from the top `r k_levels`
338+harmonized objectives to the total aid given along `r input$year_list[1]`-`r input$year_list[2]`.
269339
270340 ```{r, table4, echo=FALSE, eval=TRUE}
271341 ft <- objective_agg_long() |>
@@ -282,7 +352,7 @@
282352 autofit()
283353 ## width(width = c(2,2,2))
284354 ft <- add_header_row(
285- x = ft, values = paste("State Aid by Top Harmonized Objectives ",input$year_list[1],"-",
355+ x = ft, values = paste("State Aid by Top Harmonized Objectives along ",input$year_list[1],"-",
286356 input$year_list[2],sep=""),
287357 colwidths = c(3))
288358 ft <- theme_box(ft) %>%
@@ -290,3 +360,47 @@
290360 align(align = "right",j=c(2,3), part="body")
291361 ft
292362 ```
363+ and finally
364+
365+
366+
367+
368+```{r, echo=FALSE,fig.height = 6, fig.width = 12}
369+
370+
371+## my_pal <- viridis(length(stat_cases2 %>% pull(procedure_name) %>%
372+## unique)+1)[1:4]
373+
374+
375+
376+my_pal <- pal_npg("nrc")(k_levels+1)
377+
378+ggplot(data = yearly_objective_agg_long_top(), aes(x = expenditure_year,
379+ y=exp_mio_eur,
380+ fill=harmonised_primary_obj_top)) +
381+ geom_bar(position=position_dodge2(preserve="single"), stat="identity", alpha=1, color="black")+
382+ ## scale_fill_viridis("Vehicle Brand\nOrigin",breaks=mybreaks, labels= mylabels, discrete=T)+
383+ ## scale_colour_viridis("Vehicle Brand\nOrigin",breaks=mybreaks, labels= mylabels, discrete=T)+
384+
385+ scale_fill_manual(NULL, ## labels=c("Inward Stocks","Outward Stocks" ),
386+ values=my_pal)+
387+
388+
389+ ## coord_cartesian(ylim = c(0, 20)) +
390+ my_ggplot_theme2("top")+
391+## theme(axis.text.x = element_text(size=15,angle=90, colour="black", vjust=1))+
392+
393+ labs(title=paste("State Aid Spending in Million EUR ",input$year_list[1], "-",
394+ input$year_list[2], sep=""))+
395+ scale_x_continuous(breaks=seq(input$year_list[1], input$year_list[2]))+
396+## coord_cartesian(ylim=c(0,8000))+
397+## scale_y_continuous(sec.axis = sec_axis(~./norm_in, labels=mypercentlatex,
398+## name="Percentage of\nTotal Extra EU28",
399+## breaks=seq(0, 1, by=0.2)))+
400+## scale_y_continuous(labels=mypercentlatex)+
401+
402+ xlab("Year")+
403+ ylab("State Aid Expenditure")+
404+ guides(fill=guide_legend(nrow=2,byrow=TRUE))
405+```
406+