library("wbstats")
library("ggplot2")
library("gtrendsR")
library("usmap")
library("tidyverse")

Task 1: Use WorldBank data

food<-wb_search("Food") 
head(food,20)
## # A tibble: 20 x 3
##    indicator_id    indicator                    indicator_desc                  
##    <chr>           <chr>                        <chr>                           
##  1 1101000         1101000:FOOD AND NON-ALCOHO~ <NA>                            
##  2 1101100         1101100:FOOD                 <NA>                            
##  3 1101130         1101130:Fish and seafood     <NA>                            
##  4 1101190         1101190:Food products n.e.c~ <NA>                            
##  5 AG.AID.CREL.MT  Cereal food aid deliveries ~ Food aid shipments represent a ~
##  6 AG.AID.FOOD.MT  Total food (cereals and non~ Food aid represent a transfer o~
##  7 AG.AID.NCREL.MT Non-cereal food aid deliver~ Non-cereal commodities or commo~
##  8 AG.LND.BLY.HA   Land under barley productio~ Land under barley production re~
##  9 AG.LND.CERE.ZS  Cereal cropland (% of land ~ Land under cereal production re~
## 10 AG.LND.CREL.HA  Land under cereal productio~ Land under cereal production re~
## 11 AG.LND.FNO.HA   Land under fonio production~ Land under fonio production ref~
## 12 AG.LND.MLT.HA   Land under millet productio~ Land under millet production re~
## 13 AG.LND.MZE.HA   Land under maize production~ Land under maize production ref~
## 14 AG.LND.RICE.HA  Land under rice production ~ Land under rice production refe~
## 15 AG.LND.SGM.HA   Land under sorghum producti~ Land under sorghum production r~
## 16 AG.LND.WHT.HA   Land under wheat production~ Land under wheat production ref~
## 17 AG.PRD.BLY.MT   Barley production (metric t~ Production data on barley relat~
## 18 AG.PRD.CREL.MT  Cereal production (metric t~ Production data on cereals rela~
## 19 AG.PRD.FNO.MT   Fonio production (metric to~ Production data on fonio relate~
## 20 AG.PRD.FOOD.XD  Food production index (2004~ Food production index covers fo~
data <- wb_data("AG.AID.CREL.MT",
                    start_date = 2000, end_date = 2010)

First, Let’s look at the amount of Cereal food aid in Africa.

ggplot(data, aes(date, AG.AID.CREL.MT, group = country)) +
  geom_line(aes(color = country))+
 theme(legend.position = "none")+
   ylab("Cereal Food Aid")+
    scale_x_continuous(name="Year", breaks=seq(2000,2010,1)) + 
  labs(title = "Cereal Food Aid in Africa")

Among African countries, Ethiopia and Sudan have received the most cereal food aid, with Ethiopia being a particularly large recipient in 2003. One of the most severe droughts in the history of the country has resulted in its food aid. In 2005, Sudan experienced significant devastation, with many villages destroyed and an estimated 2 million people forcibly displaced by the Sudanese government and its militias. This campaign resulted in 70,000 deaths directly or indirectly. The events of June and November 2005 in Ethiopia, also known as the Ethiopian police massacre, involved government forces killing civilians, leading to the deaths of 193 protesters and injuring 763 others. The political violence in Sudan and Ethiopia may be related to the amount of food aid received by these countries.

newdata <- data[ which(data$country=="Ethiopia"| data$country=="Sudan"),]

ggplot(newdata, aes(date, AG.AID.CREL.MT, group = country)) +
  geom_line(aes(color = country))+
   ylab("Cereal Food Aid")+
    scale_x_continuous(name="Year", breaks=seq(2000,2010,1))+ 
  labs(title = "Cereal Food Aid in Ethiopia and Sudan")

Next, let’s look at the amount of non cereal food aid.

ncereal <- wb_data("AG.AID.NCREL.MT",
                    start_date = 2000, end_date = 2010)

Likewise, among African countries, Ethiopia and Sudan have received the most non-cereal food aid. However, Sudan has received more non-cereal food aid than Ethiopia. In particular, Sudan was a large recipient in both 2005 and 2008.

ggplot(ncereal, aes(date, AG.AID.NCREL.MT, group = country)) +
  geom_line(aes(color = country))+
 theme(legend.position = "none")+
   ylab("Non Cereal Food Aid")+
    scale_x_continuous(name="Year", breaks=seq(2000,2010,1))+ 
  labs(title = "Non Cereal Food Aid in Africa")

newnc <- ncereal[ which(ncereal$country=="Ethiopia"| ncereal$country=="Sudan"),]

ggplot(newnc, aes(date, AG.AID.NCREL.MT, group = country)) +
  geom_line(aes(color = country))+
   ylab("Non Cereal Food Aid")+
    scale_x_continuous(name="Year", breaks=seq(2000,2010,1))+ 
  labs(title = "Non Cereal Food Aid in Ethiopia and Sudan")