-
Notifications
You must be signed in to change notification settings - Fork 0
/
shiny_eurostat.Rmd
58 lines (41 loc) · 1.27 KB
/
shiny_eurostat.Rmd
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
52
53
54
---
title: "Eurostat"
output:
html_document:
theme: spacelab
runtime: shiny
---
[Takaisin etusivulle](https://okffi-science.github.io/avoin-suomi-2014)
</br>
<hr>
## Kotitalouksien tulojen kehitys
**pelkkää testausta..**
```{r, echo=FALSE}
inputPanel(
sliderInput("min", label = "Eka vuosi:",
min = 1990, max = 2011, value = 1990, step = 1),
sliderInput("max", label = "Vika vuosi:",
min = 1990, max = 2030, value = 2030, step = 1)
)
renderPlot({
minim <- as.numeric(input$min)
maxim <- as.numeric(input$max)
library(SmarterPoland)
searchresults <- grepEurostatTOC("material deprivation")
df <- getEurostatRCV(kod = "ilc_mddd21")
# Plot at nuts2-level
# time variable into numerical
df$time <- as.numeric(levels(df$time))[df$time]
cname <- subset(df, time == 2011)
# plot
library(ggplot2)
ggplot(df, aes(x = time, y = value, color = geo, group = geo)) +
geom_point() +
geom_line() +
geom_text(data = cname, aes(x = time, y = value, label = geo), hjust = -0.3) +
theme(legend.position = "none") +
labs(title = "material deprivation in EU at NUTS2-level", y = "population share (%)") +
coord_cartesian(xlim = c(minim, maxim)) +
scale_x_continuous(breaks = minim:maxim)
})
```