💾 Archived View for gemlog.blue › users › cariboudatascience › 1615345388.gmi captured on 2024-03-21 at 17:13:47. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

-=-=-=-=-=-=-

Cereals Consumption by Cereal Type Worldwide (Part 2)

"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."

Source: Our World In Data

Begin R Code:

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)

cereals_longer <- cereals %>% filter(Country !="World") %>% select(-Code) %>%
  pivot_longer(cols = Wheat:Sorghum) 

 cereals_by_years <- cereals_longer %>% filter(value >0) %>% group_by(name,Year) %>% 
  summarise(Count = n(),
            Total = sum(value),
            Mean = mean(value)) %>% ungroup()

ggplot(cereals_by_years) + geom_line(aes(x=Year,y=Total,col=name),lwd=1) +
  scale_y_log10(labels = comma) + 
  labs(title="Total kilocalories Per Year by Cereal Type")

Total kilocalories Per Year by Cereal Type

ggplot(cereals_by_years) + geom_line(aes(x=Year,y=Total),lwd=1) + 
  facet_wrap(~name,scale = "free_y",ncol=2) +
  scale_y_log10(labels = comma) + 
  labs(title="Total kilocalories Consumed Per Year by Cereal Type")

Total kilocalories Consumed Per Year by Cereal Type

Resources:

R Code and Data

R Language and Rtools40 (click and "base" and "Rtools")

Download and install RStudio

Comments, Question and Request