💾 Archived View for gemlog.blue › users › cariboudatascience › 1614212750.gmi captured on 2023-07-22 at 18:16:43. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

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

Worldwide Vegetable Consumption Per-Capita (1961-2017)

Data Source: http://ourworldindata.org

Software required to recreate plot:

Run Code:

library(ggplot2)
library(scales)
library(tidyr)
library(dplyr)

vegetable_consumption <- read.csv("./DATA/20-vegetable-consumption-per-capita.csv")
colnames(vegetable_consumption) <- c("Country","Code","Year","Vegetables")

### Worldwide vegetable Consumption per Capita
vegetable_consumption %>% filter(Country == "World") %>%
  ggplot() + geom_line(aes(x=Year,y=Vegetables)) +
  scale_y_continuous(labels=comma) +
  labs(title="Worldwide Vegetable Consumption Per Capita by Year",
       subtitle = "(1961 - 2017)",
       y="Kilogram/Person/Year")

## Top Five Countreis with hight per cap consumption

vegie_top <- vegetable_consumption %>% filter(Year =="2017") %>%  top_n(5,Vegetables)
vegie_top <- as.data.frame(vegie_top)

ggplot(vegie_top) + geom_col(aes(x=reorder(Country,Vegetables),y=Vegetables)) + coord_flip() +
  labs(title="Top Five Countries Rata by Per Capita Consumption")

### Plot Bottom Five Countries by Per Capita Consumption

vegie_bottom <- vegetable_consumption %>% filter(Year =="2017") %>%  top_n(-5,Vegetables)
vegie_bottom <- as.data.frame(vegie_bottom)

ggplot(vegie_bottom) + geom_col(aes(x=reorder(Country,Vegetables),y=Vegetables)) + coord_flip() +
  labs(title="Bottom Five Countries Rata by Per Capita Consumption")
 

Video Walkthrough

Plots:

Bottom Five Countries Per capita

Top Five Countries Per-capita

worldwide Veggie Consumption (per Capita).

Resources:

R Code, and data

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

Download and install RStudio

Comments, Questions, Request:

https://github.com/davidjayjackson/OWID-diet-vegetable-fruit/issues