Static Plots

Column

---
title: "Dashboards World Bank Indicators"
author: "Shadi Henchiri"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    social: menu
    source_code: embed
---

```{r setup, include=FALSE}


linkCSV='https://github.com/pubpolicy/PubPolicy-543/raw/main/gbdChildMortality_2011s.csv'

dataCSV=read.csv(linkCSV)

location="https://github.com/pubpolicy/PubPolicy-543/raw/main/"
file="WB_countries_Admin0_10m.json"

linkToFile=paste0(location,file)
```
Static Plots
=======================================================================

Column {data-width=20}
-------------------------------------
```{r,fig.height=6, fig.width=11}
library(sf)
library(tidyverse)

mapWorld=read_sf(linkToFile)

mapWorldVars=merge(mapWorld, #map first
                   dataCSV, 
                   by.x='ISO_A3', by.y='iso')


library(ggplot2)
# plot original map
base=ggplot(data=mapWorld) + geom_sf(fill='grey90',
                                     color=NA) + theme_classic()




titleText='Selected NRAs by World Bank Economic Regions'
sourceText='Source: World Bank'
colMap= base + geom_sf(data=mapWorldVars,
                       aes(fill=ECONOMY),
                       color=NA) + labs(title=titleText,
                     x =NULL,
                     y = NULL,subtitle = "Source: PATH 2021")+ theme(legend.title.align = 0.5,legend.title=element_text(margin = margin(t = 10),size=8, face = "bold"),legend.text=element_text(size=10, face = "bold"),plot.caption = element_text(hjust = 2,face = 'bold',size = 8), 
                      plot.title = element_text(hjust = 0.7, size = 15,face = "bold"),legend.key.size = unit(0.7, "cm"),axis.ticks = element_blank(),axis.text.x = element_blank(),
        axis.text.y = element_blank())+ theme(axis.text.x = element_text(angle = 0, 
                                         hjust = 1,
                                         size = 15, face = "bold"),
              axis.text.y = element_text(size = 15, face = "bold"))


colMap
```