r-eurostat-refugees cheat sheet

Some hints at how to use eurostatasyl

Prepare packages / libraries

ipak <- function(pkg){
    new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
    if (length(new.pkg)) 
        install.packages(new.pkg, dependencies = TRUE)
    sapply(pkg, require, character.only = TRUE)
}


packages <- c("ggplot2", "plyr", "reshape2", "RColorBrewer", "scales", "grid")
list.of.packages <- c("tidyr", "dplyr", "magrittr", "ggplot2", "eurostat", "gridExtra", "lubridate")
ipak(list.of.packages)
library(eurostatasyl)

Compare acceptance of asylum requests of one country of origin, across countries of application

  1. load data: acc_data = load_data_acceptance_file('/full/path/to/data/data_acceptance') to get the data from the file, or acc_data = load_data_acceptance() to get it from eurostat.
acc_data = load_data_acceptance_file('/Users/suny/r-eurostat-refugees/data/data_acceptance')

This will load 8.6 MB / 45 mio values and look like

  1. Have a look at the structure of the data
str(acc_data)

Have a look at the data itself:

View(acc_data)

to see all Countries of Origin:

unique(acc_data[[1]])

to see all countries of destination / where the application was submitted, or decided:

unique(data[[5]])


muc-fluechtlingsrat/r-eurostat-refugees documentation built on May 23, 2019, 8:20 a.m.