knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE)
Hauptartikel ist "Aylsentscheidungen in Europa, Fokus Afghanistan". Dies gehört zu den ergänzenden Analysen. Vierte Ergänzung TOTAL hat Probleme. Ich versuche es deshalb mit "Alle außer Afghanistan".
library(knitr) library(dplyr) migr_asydcfsta=readRDS(file="/tmp/migr_asydcfsta_20180812.rds")
cutoff=1000 CODE="TOTAL" EXCLUDE="AF" COUNTRY="Total without Afghanistan" major_geo_total_exaf=filter(migr_asydcfsta, values > cutoff, time == "2017-01-01", decision == "TOTAL", sex == "T", age == "TOTAL", citizen == CODE, citizen != EXCLUDE, geo != "EU28") %>% select(geo,values)
Dies sind die europäischen Länder, in denen im Jahr 2017 mehr als cutoff
Entscheidungen über Asylanträge von syrischen Staatsangehörigen getroffen wurden:
library(knitr) # Die ersten paar Spalten kable(major_geo_total_exaf[(-major_geo_total_exaf$values),], caption = paste("Länder mit mehr als ", cutoff, " Entscheidungen zu Asylanträgen aus ", COUNTRY )) major_geo_total_exaf <- filter(major_geo_total_exaf, geo != "TOTAL")
Anzahl der Entscheidungen in Ländern mit weniger als r cutoff
Entscheidungen - die werden im Folgenden vernachlässigt:
other_geo_total_exaf=filter(migr_asydcfsta, values <= cutoff, time == "2017-01-01", decision == "TOTAL", sex == "T", age == "TOTAL", citizen == CODE, citizen != EXCLUDE, geo != "EU28", geo != "TOTAL") %>% arrange(desc(values)) dec_others_total_exaf <- sum(other_geo_total_exaf$values) dec_others_total_exaf
Eine Visualisierung der Gesamtanzahl von Entscheidungen zu COUNTRY
im Jahr 2017:
library(ggplot2) # some technical workarounds for adding the row with the others (XX), # and for sorting major_geo_total_exaf$geo <- as.character(major_geo_total_exaf$geo) all_geo_total_exaf <- rbind(major_geo_total_exaf, c("XX",dec_others_total_exaf)) all_geo_total_exaf$values <- as.numeric(all_geo_total_exaf$values) all_geo_total_exaf$geo <- factor(all_geo_total_exaf$geo, levels = arrange(all_geo_total_exaf, values)$geo) # The real thing geo_dec_pie_exaf <- ggplot(all_geo_total_exaf, aes(x="", y=values, fill=geo)) + geom_col(colour = "black") + coord_polar("y", start=0) + scale_fill_grey(start = 0.4, end = 0.9) + ggtitle (paste("Entscheidungen über Asyl, ",COUNTRY,", 2017"), subtitle = paste("EU-Länder; XX ist die Summe aller Länder mit > ", cutoff, " Entscheidungen")) + theme_bw() + theme(axis.title=element_blank()) geo_dec_pie_exaf
major_geo_exaf <-filter(migr_asydcfsta, geo %in% major_geo_total_exaf$geo, time >= "2017-01-01", sex == "T", age == "TOTAL", citizen == CODE, geo != "EU28", geo != "TOTAL") %>% select(geo,decision,values) major_geo_exaf$geo <- factor(major_geo_exaf$geo, levels = arrange(filter(major_geo_exaf, decision == "TOTAL"), desc(values))$geo) # bring decisions into correct order major_geo_exaf$decision <- factor(major_geo_exaf$decision, levels=c("REJECTED","TEMP_PROT","HUMSTAT","SUB_PROT","GENCONV","TOTAL_POS","TOTAL"))
dec_palette_grey=c("#000000","#C0C0C0","#D3D3D3","#E4E4E4","#E8E8E8","#C8C8C8","#808080") dec_bar <- ggplot(filter(major_geo_exaf, decision != "TOTAL" & decision != "TOTAL_POS")) + geom_col(aes(x=geo, y=values, fill=decision)) dec_bar + scale_fill_manual(values = dec_palette_grey) + theme_bw() + theme(legend.position="bottom") + ggtitle(paste("Entscheidungen über Asylanträge aus ",COUNTRY," 2017"), subtitle = "in absoluten Zahlen")
dec_bar_fill <- ggplot(filter(major_geo_exaf, decision != "TOTAL" & decision != "TOTAL_POS")) + geom_col(aes(x=geo, y=values, fill=decision), position="fill") + scale_fill_grey() + theme_bw() + theme(legend.position="bottom") + ggtitle(paste("Entscheidungen über Asylanträge aus ",COUNTRY," 2017"), subtitle = "in Prozent") dec_bar_fill
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.