Skip to content

Instantly share code, notes, and snippets.

@mschnetzer
Last active August 14, 2018 16:42
Show Gist options
  • Save mschnetzer/b6027d5b8e501afa023c1ac02b06a7bf to your computer and use it in GitHub Desktop.
Save mschnetzer/b6027d5b8e501afa023c1ac02b06a7bf to your computer and use it in GitHub Desktop.
Gründe für Teilzeitarbeit nach Geschlecht in Österreich (https://twitter.com/matschnetzer/status/974591614244020226)
library(tidyverse)
library(waffle)
library(viridis)
data <- data_frame(
labs = c("Betreuung/Pflege","Keine Vollzeit gewünscht","Andere persönliche Gründe","Keine Vollzeit gefunden",
"Aus-/Fortbildung","Krankheit","Sonstige Gründe"),
male = c(4.6,18.8,14.4,17.3,29.9,5.9,9.2),
female = c(38.6,19.2,16.54,10.5,8.9,2.5,3.7)
)
data %>% select(labs,male) %>% mutate_if(is.numeric, funs(round(., 0))) %>% mutate(labs = sprintf("%s (%s%%)", labs, male)) %>%
waffle(
rows=5, size=0.5, legend_pos="bottom", colors = c("red",viridis_pal(option = "plasma")(6))
)
data %>% select(labs,female) %>% mutate_if(is.numeric, funs(round(., 0))) %>% mutate(labs = sprintf("%s (%s%%)", labs, female)) %>%
waffle(
rows=5, size=0.5, legend_pos="bottom", colors = c("red",viridis_pal(option = "plasma")(6))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment