Phase 1 - Drafting a project

The idea of the data project is to extract and process some nutrient data from a provided table. Based on some predefined foods that were (hypothetically) consumed within a day, the project aims to answer i) to which extent ones energy demand is saturated, ii) how much each macronutrient (i.e., carbs, lipids, proteins) contributes to ones daily energy uptake, and iii) to which extent ones mineral (i.e., Calcium, Phosphorus, Sodium) and vitamin (i.e., B1, B2, B6) demand is saturated. i) and ii) could be visualised somehow in the same pie plot. iii) could be represented well by a histogram. The drawing of one possible outcome is shown elsewhere.

To this end, you are supposed to filter the dataset for some predefined foods (perhaps your favourite foods you wish to eat within a day? Any food plan could offer some alternative daily food “recommendations”. But be careful, your food might be found under another name in the dataset. You could also use the two plans provided below.). Then, you should calculate the total uptake (in g or mg) from the foods, i.e., the uptake of the aforementioned macronutrients, minerals, and micronutrients. Therefore, you need to approximate the amount of all foods that were consumed. Finally, you can calculate a (fictive) persons Daily Energy Demand and the relative contribution of each macronutrient. The total mineral and micronutrient uptake only needs to be summed up.

Potential additions to the project:
-The dataset could be imported directly from the webpage.
-In the end, you could create an output file with all the information necessary to recreate the plots and a add a respective date to create some kind of dietary history.

Data Set

The Swiss Food Composition Database provided by the state of Swizzerland is used for the project. It is a database consisting of over 1000 different food and drinks and the nutrient composition of these.

Data Preview

X1 X2 X3 X4 X5 X6 X7 X8 X9 X10
Swiss food composition database – Generic foods V6.5 (27.06.2023) NA NA NA NA NA NA NA NA NA
Corrected version 17.08.2023 (Correction: nutrient “Zinc”, food 13420 “Beer, non-alcoholic”) NA NA NA NA NA NA NA NA NA
ID ID V 4.0 ID SwissFIR Name Synonyms Category Density Matrix unit Energy, kilojoules (kJ) Derivation of value
10533 NA NA Agar Agar NA Various/Gelling and binding agents NA per 100g edible portion 641 Automated calculation
10536 NA NA Agave syrup NA Sweets/Sugar and sweeteners NA per 100g edible portion 1240 Automated calculation

Entries of the data table are shown for the first ten out of 129 columns.

The complete data set is provided by and available at The Swiss Food Composition Database.

Visualisation goals:

The data could be represented as a pie chart and one or more histograms. A visualisation-example-drawing is shown below (Note: The legened is only valid for the histogram.). The pie chart can show the relative energy uptake per macronutrient and directly compare it to some general recommendation given below. You could add some bar showing the actual energy uptake vs the energy demand. The one or more histograms could represent the uptake of minerals and micronutrients as bars that show the “progress” in achieving ones demand (given below).

The figures could also be simplified and the data presented in several charts.

Lokales Bild
Lokales Bild

Required information

Calculation of Daily Energy Demand


\(Basal \ Metabolic \ Rate \ (BMR) = 4.2 \ \mathrm{kJ/(kg \cdot hours)} \cdot h \cdot m\)

\(Daily \ Energy \ Demand \ (DEM) = BMR \cdot PAL\)

\(Energy \ Uptake_{macronutrient} = Energy \ Density_{macronutrient} \cdot Total \ Uptake_{macronutrient}\)

with:
-hours of a day h (= 24 hours),
-body weight of the person of interest [kg],
-and Physical Activity Level (PAL = 1.65).

Some general recommendation for the saturation of the Daily Energy Demand [kJ] by the macronutrients carbo hydrates, lipids, and proteins is 55%, 30%, and 15%, respectively.

Nutrient demand and energy density

Mineral Demand [mg/day]
Calcium 1000
Phosphorus 700
Sodium 1500
Micronutrient Demand [mg/day]
Vitamin B1 (Thiamine) 1.1
Vitamin B2 (Riboflavin) 1.2
Vitamin B6 (Pyridoxine) 1.5
Macronutrient Energy density [kJ/g]
Carbo hydrates 17
Lipids 37
Proteins 17




Note: Some of the given demand values vary between people and thus, were approximated/averaged where necessary.

Example dietary plans

Day 1:
-Wholegrain Bread: 100g
-Apple: 150g
-Chicken Breast, cooked: 120g
-Broccoli, steamed: 100g
-Olive Oil: 10g
-Almonds: 30g
-Low-fat Yogurt: 150g


Day 2:
-Rice, cooked: 150g
-Banana: 120g
-Salmon, grilled: 150g
-Spinach, cooked: 100g
-Sunflower Oil: 10g
-Walnuts: 20g
-Milk, semi-skimmed: 200ml