---
title: "MIDDLE EAST & NORTH AFRICA (MENA) REFUGEE CRISIS"
author: "Himanshu Soni & Manan Soni"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
social: menu
source: embed
---
```{r setup, include=FALSE}
library(flexdashboard)
library(ggplot2)
library(ggmap)
```
#SUMMARY {.sidebar}
Refugees are not a new phenomenon in the Middle East and North Africa (MENA). The ojective of this dashboard is to highlight and discuss major countries affected in the MENA region.
The density map reveals majority of the seekers belong to Syria, Iraq, Afghanistan, Pakistan, Iran, Somalia, Turkey, Ukraine, Albania, and Sudan (Top 10). Citizens of all of these countires have been through hardships deteriorating their standard of life and ultimately forcing them to leave their home countires. Next, a time-series analysis shows a drastic increase of seekers post 2010 indicating the heightening of political/regional tensions. Looking at the demographic structure it is clear that gender-wise numbers are almost equal, however, age-wise the biggest group of seekers is the age group 18-59. Lastly, we extend our analysis to find which countries in Europe have welcomed most seekers - results show Germany, France and Uited Kingdom are the front-runners (Top 3).
#DASHBOARD {data-icon="fa-map"}
##Column1 {data-width=650 .tabset .tabset-fade}
### DENSITY MAP OF MENA COUNTRIES
```{r MENA, echo=FALSE}
Asia_map <- qmap('Middle East & Europe', zoom = 4, source = "google", maptype = "roadmap", scale = 2, extent = "panel")
MEdata <- read.csv("/Users/Himanshu/Desktop/Seekers2.csv")
Asia_map + geom_point(aes(x=lon, y=lat), data = MEdata, col = "orange", alpha = 0.5, size = MEdata$Seekers/40000) + scale_size_continuous(range = range(MEdata$Seekers))
```
### DENSITY MAP OF RESIDENT COUNTRIES
```{r Europe, echo=FALSE}
Europe_map <- qmap('Europe', zoom = 4, source = "google", maptype = "roadmap", scale = 2, extent = "panel")
MEdata2 <- read.csv("/Users/Himanshu/Desktop/Residence2.csv")
Europe_map + geom_point(aes(x=lon, y=lat), data = MEdata2, col = "dark blue", alpha = 0.5, size = MEdata2$Seekers/80000) + scale_size_continuous(range = range(MEdata2$Seekers))
```
##Column 2 {data-width=350}
### TIME-SERIES ANALYSIS OF SEEKERS {data-height=500}
```{r Yearly, echo=FALSE}
SeekersYearly <- read.csv("/Users/Himanshu/Desktop/SeekersYearly.csv")
ggplot(aes(x=Year, y=Seekers), data = SeekersYearly) + geom_line(col = "orange", lwd=2.5, lty=6)
```
### POPULATION PYRAMID OF SEEKERS (in 100 thousands) {data-height=500}
```{r}
DemoMF <- read.csv("/Users/Himanshu/Desktop/Demographic.csv")
ggplot(data = DemoMF, mapping = aes(x=Age, fill=Gender, y = ifelse(test = Gender == "Male", yes = -Population/100000, no = Population/100000))) + geom_bar(stat = "identity") +
scale_y_continuous(labels = abs, limits = max(DemoMF$Population/100000) * c(-1,1)) +
labs(y = "Population") + scale_fill_brewer(palette = "Oranges") + coord_flip()
```