Skip to content

Instantly share code, notes, and snippets.

@patperu
Last active October 1, 2019 16:01
Show Gist options
  • Save patperu/756a4c1b637d0fea4170df17cebc4596 to your computer and use it in GitHub Desktop.
Save patperu/756a4c1b637d0fea4170df17cebc4596 to your computer and use it in GitHub Desktop.
Mietdifferenz
library(tidyverse)
library(ggchicklet)
library(hrbrthemes)
# https://www.destatis.de/DE/Presse/Pressemitteilungen/2019/10/PD19_N01_129.html
readr::read_csv2('nettokaltmieten.csv') %>%
mutate(Mietdifferenz = ((`Einzug 2015 oder später`/ Insgesamt) - 1) * 100) %>%
mutate(width = 0.75, Kategorie = fct_reorder(Kategorie, Mietdifferenz, .desc = FALSE)) %>%
ggplot(aes(Kategorie, Mietdifferenz)) +
geom_chicklet( radius = grid::unit(9, "pt"), fill = '#436f82') +
scale_y_comma(position = "right") +
coord_flip() +
labs(title = "Prozentuale Differenz der Miete pro qm zwischen\n'Einzug 2015 oder später' und 'Insgesamt'",
subtitle = "....",
caption = "Destatis, Mikrozensus-Zusatzerhebung zur Wohnsituation in Deutschland für das Jahr 2018",
x = NULL, y = "Prozent") +
theme_ipsum_rc(grid="X")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment