1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Statistics in R

Connected

Exercise

Mean and median

In this chapter, you'll be working with the food_consumption dataset from 2018 Food Carbon Footprint Index by nu3. The food_consumption dataset contains the number of kilograms of food consumed per person per year in each country, food category column food_category, the amount of consumption, and its carbon footprint (co2_emissions) measured in kilograms of carbon dioxide, or CO2.

dplyr is loaded for you and food_consumption is available.

Instructions 1/3

undefined XP
  • 1
    • Calculate the mean of food consumption in kilograms for all countries in the food_consumption dataset.
  • 2
    • Calculate the median of food consumption in kilograms for all countries in the food_consumption dataset. Is it the same as the mean?
  • 3
    • Calculate the mode of consumption for all countries in the food_consumption dataset by counting and sorting values descending.