A plot of average cereal yeilds in kgs per hectare in Nepal, Poland, and the US from 1970 to 2019 is provided below.
library(wbstats) # to access WorldBank data
# fetch the dataseries for the desired indicator
forests <- wb_data("AG.YLD.CREL.KG", country = c("USA", "Nepal", "Poland"), 1970, 2020)
library(ggplot2) # for mapping
# make a simple plot with the data
ggplot(forests, aes(date, AG.YLD.CREL.KG))+ geom_line(aes(color = country)) +labs(title="Historical Cereal Yields Data", x = "Year", y = "Average Cereal Yield (KG per hectare)")
Next, we are going to study the popularity of Hindustani Classical Music over time.
# load the gtrends library
library(gtrendsR)
raga <- data.frame(gtrends(c("hindustani classical", "shastriya sangeet", "hindustani music"), time = "all", low_search_volume = T)$interest_over_time)
ggplot(raga, aes(date, hits, color = keyword)) + geom_line() + labs(title="Google searches for Hindustani Classical Music", x = "Year", y = "Number of searches")