## Cereals Consumption By Type (Kilocalories/person/year) [Part 3] => HTTP://ourworldindata.org Data Source ### Begin Code ``` library(ggplot2) library(scales) library(dplyr) library(tidyr) library(readr) library(flextable) library(dlookr) ``` ### Table of Summary Statistics 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") dlookr::diagnose_numeric(cereals) %>% flextable() ``` => https://github.com/davidjayjackson/OWID-cereals-by-commodity/blob/master/cereals_05.png Summary Stats ``` world_longer <- cereals %>% filter(Country =="World") %>% select(-Code) %>% pivot_longer(cols = Wheat:Sorghum) ``` ### Histograms by Cereals Type ``` ggplot(world_longer) + geom_histogram(aes(x=value),bins=10) + facet_wrap(~name) + labs(title="Count of Calories by Cereals") ``` => https://github.com/davidjayjackson/OWID-cereals-by-commodity/blob/master/cereals_06.png Histogram by Cereals Type ### Resources: => 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