Last active
August 14, 2018 16:39
-
-
Save mschnetzer/830f4c44d44685ecbce06dddb0261abe to your computer and use it in GitHub Desktop.
Leistbarkeit von Gesundheitsleistungen in der EU (https://twitter.com/matschnetzer/status/982250661411565569)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(eurostat) | |
library(tidyverse) | |
library(RColorBrewer) | |
library(ggthemes) | |
data <- get_eurostat("ilc_ats12",filters=list(hhtyp="TOTAL",incgrp="TOTAL",unit="PC_POP"),type="label",lang="de") %>% | |
select(geo,lev_diff,values) %>% spread(lev_diff,values) %>% | |
mutate(leicht=`Leicht `+`Relativ leicht `+`Sehr leicht`,schwierig=Groß+Mässig+Einige) %>% | |
filter(!geo %in% c("Europäische Union (derzeitige Zusammensetzung)", "Europäische Union (vor dem Beitritt Kroatiens)", | |
"Euroraum (19 Länder)", "Euroraum (18 Länder)")) %>% | |
mutate(geo=recode(geo, "Deutschland (bis 1990 früheres Gebiet der BRD)" = "Deutschland")) | |
# As barchart | |
data %>% select(geo,leicht) %>% | |
ggplot(aes(x=reorder(geo,leicht),y=leicht)) + | |
geom_bar(stat = "identity",fill="darkorange2") + | |
geom_text(aes(label=leicht,y=3,fontface = "bold"),color="white") + | |
coord_flip() + theme_minimal() + scale_y_continuous(limits = c(0,100)) + | |
scale_x_discrete(expand = c(0,0)) + | |
labs(title = "Können Sie sich Gesundheitsleistungen leisten?", | |
subtitle = "% der Personen ohne Probleme bei der Finanzierung von Gesundheitsleistungen", | |
caption = "Quelle: EUROSTAT. Grafik: M. Schnetzer", x="",y="") + | |
ggsave(filename="healthafford.png",scale=2,width=4.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment