How about relation between consumption vs. emmission in every food category?
food_consumption %>%
gather(key = "feature", value = "value", -food_category, -country) %>%
mutate(feature = str_to_title(feature %>% str_replace("_", " "))) %>%
ggplot() +
geom_bar(aes(x = feature, y = value, fill = feature), stat = "identity") +
facet_wrap(~food_category, scales = "free") +
theme(legend.position = "bottom",
axis.text.x = element_blank()) +
labs(x = "Features",
y = element_blank(),
fill = "Feature")
Beef and Milk-inc, Cheese produce CO2 emmission most higher than other food category.
food_consumption %>%
gather(key = "feature", value = "value", -food_category, -country) %>%
mutate(feature = str_to_title(feature %>% str_replace("_", " "))) %>%
ggplot() +
geom_density(aes(value, fill=feature, alpha = 0.7)) +
facet_wrap(~food_category, scales = "free") +
scale_x_log10() +
theme(legend.position = "bottom") +
labs(x = "Features",
y = element_blank(),
fill = "Feature")
Soybean and Wheat products have lower CO2 emissions than their consumption. Table of the relationship between total food consumption and total food emmission is shown below.
food_consumption %>%
group_by(food_category) %>%
summarise(total_consumption = sum(consumption),
total_co2emmission = sum(co2_emmission)) %>%
arrange(-total_consumption) %>%
kable()
Milk - inc. cheese |
16350.71 |
23290.00 |
Wheat and Wheat Products |
9301.44 |
1773.78 |
Rice |
3818.77 |
4886.91 |
Poultry |
2758.50 |
2963.16 |
Fish |
2247.32 |
3588.22 |
Pork |
2096.08 |
7419.11 |
Beef |
1576.04 |
48633.26 |
Eggs |
1061.29 |
974.95 |
Nuts inc. Peanut Butter |
537.84 |
951.99 |
Lamb & Goat |
338.02 |
11837.38 |
Soybeans |
111.87 |
50.35 |
Consumption Map
map <- food_consumption %>%
group_by(country) %>%
summarise(total_consumption = sum(consumption),
total_co2emmission = sum(co2_emmission)) %>%
arrange(-total_consumption) %>%
mutate(country = recode_factor (country,
`USA` = "United States",
`Czech Republic`= "Czech Rep.",
`South Korea`= "Korea"))
map %>%
e_charts(country) %>%
e_map(total_consumption) %>%
e_visual_map(min=0,
max=700) %>%
e_title("\nTotal Consumption by Country \n (kg/person/year)\n", left = "center") %>%
e_theme("auritus")
map %>%
head(10) %>% kable()
Finland |
639.79 |
1464.63 |
Lithuania |
555.01 |
868.90 |
Sweden |
550.00 |
1527.03 |
Netherlands |
534.17 |
1292.82 |
Albania |
532.73 |
1777.85 |
Ireland |
518.65 |
1459.67 |
Switzerland |
514.90 |
1356.75 |
Italy |
513.98 |
1206.33 |
Denmark |
499.07 |
1498.18 |
Luxembourg |
497.90 |
1598.41 |
CO2 Emmission Map
map %>%
e_charts(country) %>%
e_map(total_co2emmission) %>%
e_visual_map(min = 0,
max = 2200) %>%
e_title("\nTotal CO2 emissions by Country \n (kg CO2/person/year)\n",
left = "center") %>%
e_theme("essos")
map %>%
arrange(-total_co2emmission) %>%
head(10) %>% kable()
Argentina |
429.41 |
2172.40 |
Australia |
465.09 |
1938.66 |
Albania |
532.73 |
1777.85 |
New Zealand |
360.92 |
1750.95 |
Iceland |
472.31 |
1731.36 |
United States |
491.15 |
1718.86 |
Uruguay |
433.60 |
1634.91 |
Brazil |
355.16 |
1616.73 |
Luxembourg |
497.90 |
1598.41 |
Kazakhstan |
468.10 |
1575.08 |