library("wbstats")
library("ggplot2")
library("gtrendsR")
library("usmap")
library("tidyverse")
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")
I would like to see Google trends for kpop in the last 12 months.
kpop<-gtrends("kpop", geo = c("CA","US"), time="today 12-m")
kpop_time<-kpop$interest_over_time
I noticed that the search interest for K-pop was highest on July 17th, 2022. Curious about what caused the spike, I investigated and discovered that a K-pop concert was held on the same day. Interestingly, the search term ‘K-pop concert’ continued to trend in the following days. It’s possible that people were searching for concert reviews, resulting in the continued high search interest.
ggplot(kpop_time, aes(date, hits, group = geo)) +
geom_line(aes(color = geo))+
ylab("Google tredns for kpop")+
labs(colour = "Country") +
geom_vline(xintercept = as.POSIXct(as.Date("2022-07-17")),color = "black",linetype="dashed")+
labs(title = "Google Trends for kpop")
concert<-gtrends("kpop concert", geo = c("CA","US"), time="today 12-m")
concert_time<-concert$interest_over_time
ggplot(concert_time, aes(date, hits, group = geo)) +
geom_line(aes(color = geo))+
ylab("Google tredns for kpop concert")+
labs(colour = "Country") +
geom_vline(xintercept = as.POSIXct(as.Date("2022-07-17")),color = "black",linetype="dashed")+
labs(title = "Google Trends for kpop concert")
I also wanted to explore which state has the highest interest in K-pop. According to Google Trends data, Hawaii and California show the highest search interest in K-pop, followed by Nevada, Texas, and Georgia.
kpopstates<-kpop$interest_by_region
kpopstates <- kpopstates[ which(kpopstates$geo=="US"),]
kpopstates$fips <-fips(kpopstates$location)
plot_usmap(data = kpopstates, values = "hits", color = "red", labels=FALSE) +
scale_fill_continuous( low = "white", high = "red",
name = "Hits", label = scales::comma) +
theme(legend.position = "right") +
theme(panel.background = element_rect(colour = "black")) +
labs(title = "Google Trends for K-pop by State")