## Cereals Consumption by Cereal Type (per Capita) Worldwide (Part 1) => ### Data: http://ourworldindata.org Source: Our World In Data "Breakdown of the average per capita intake of cereals by specific cereal-based commodity types,measured in kilocalories per person per day. This figure measures the primary equivalent of all food products derived from a given commodity (e.g. "wheat" represents the primary equivalent of its derived products). Data refers to cereal food supply at the consumer level but does not account for consumer wastage." => https://ourworldindata.org/grapher/per-capita-consumption-of-cereals-by-commodity-type-daily-kilocalories => https://youtu.be/YchgYNCaiOE Video Walkthrough ### Begin R Code: ``` library(ggplot2) library(scales) library(tidyr) library(dplyr) cereals <- read.csv("./DATA/per-capita-consumption-of-cereals-by-commodity-type-daily-kilocalories.csv") colnames(cereals) <- c("Country","Code","Year","Wheat","Rice","Barley","Maize","Rye","Oats","Sorghum") summary(cereals) world_longer <- cereals %>% filter(Country =="World") %>% select(-Code) %>% pivot_longer(cols = Wheat:Sorghum) world_yearly <- world_longer %>% group_by(Year) %>% summarise(Total = sum(value), Median = median(value), Mean = mean(value)) ``` => https://github.com/davidjayjackson/OWID-cereals-by-commodity/blob/master/cereals01.png Worldwide Cereals: kilocalories per person per day ``` ggplot(world_yearly) + geom_line(aes(x=Year,y=Mean),lwd=1.5,col="darkblue") + labs(title="Worldwide Cereals: Mean kilocalories per person per day",y=" Mean Calories(x1000)/capita/day") + scale_y_continuous(labels = comma) ``` => https://github.com/davidjayjackson/OWID-cereals-by-commodity/blob/master/cereals02.png Worldwide Cereals: Mean kilocalories per person per day ### Resources: => https://youtu.be/l-DZAOYOXxM Video Walkthrough => https://github.com/davidjayjackson/OWID-cereals-by-commodity R Code and Data => https://cloud.r-project.org/ R Language and Rtools40 (click and "base" and "Rtools") => https://rstudio.com/products/rstudio/download/ Download and install RStudio => https://github.com/davidjayjackson/OWID-diet-vegetable-fruit/issues Comments, Question and Request