Today’s topic will be about knowing your food. The Data set we will be looking at is sourced from the USDA website https://fdc.nal.usda.gov/. Variables includes foods with their macronutritirent , vitamins and minerals totaling 53 variables. There are 8000+ observations.
I first took that data-set and made it a bit more into a manageable size taking 29 of the variables. I use mutate 3 times to create a new variables labeling each food to its respected level of macronutrient using the case_when. after that i mutated once more to label each food item into a category, such as red meats, fish, nuts, and so on.
I choose this topic to inform the general population of a different way to diet. People often think of a diet as something restricting, which is how many end up “failing” or “yo-yoing.” Being a Trainer in the current fitness industry I am tired of people putting themselves through bad information and just want to guild and teach them to path of lasting success.
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.3 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ ggplot2 3.4.3 ✔ tibble 3.2.1
✔ lubridate 1.9.2 ✔ tidyr 1.3.0
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
#library(data.table)
setwd("C:/Users/It's Me Betty/Documents/MC. Data 110")USDAa <-read_csv("food_nutrient_composition_USDA.csv",locale=locale(encoding="latin1"), show_col_types =FALSE ) #File had a charatcher that was not encoded properly, just this code allowed it to read into RStudio
#headers <- names(USDAa)#headersUSDAb <- USDAa [, c("Shrt_Desc","Energ_Kcal","Water_(g)", "Ash_(g)", "Protein_(g)", "Lipid_Tot_(g)", "Carbohydrt_(g)","Fiber_TD_(g)", "Sugar_Tot_(g)", "Cholestrl_(mg)", "FA_Sat_(g)", "FA_Mono_(g)", "FA_Poly_(g)", "GmWt_1", "GmWt_Desc1", "GmWt_2", "GmWt_Desc2" , "Calcium_(mg)", "Magnesium_(mg)", "Potassium_(mg)", "Sodium_(mg)", "Thiamin_(mg)", "Selenium_(µg)", "Alpha_Carot_(µg)", "Beta_Carot_(µg)", "Beta_Crypt_(µg)", "Lycopene_(µg)", "Vit_C_(mg)", "Vit_E_(mg)")]#sapply(USDAb, class)names(USDAb)[names(USDAb) =="Lipid_Tot_(g)"] <-"Fat_(g)"#Lipid is a fancy way to say Fatcolnames(USDAb) <-gsub("\\(|\\)", "", colnames(USDAb))#removing the () from orginal data headers
USDAd <- USDAb |>mutate(Fat_Rating =case_when( Fat_g ==0.00& Fat_g <=0.99~"Fat-free", Fat_g >=1& Fat_g <=15.99~"Low Fat", Fat_g >=16& Fat_g <=22.99~"Low Moderate Fat", Fat_g >=23& Fat_g <=38.99~" Moderate Fat", Fat_g >=39& Fat_g <=55.99~" Moderate High Fat", Fat_g >=56& Fat_g <=69.99~" High Fat", Fat_g >=70& Fat_g <=90.99~"Really High Fat", Fat_g >=91& Fat_g <=100~"All Fats",TRUE~NA_character_# default value if none of the conditions are met )) |>mutate(Protein_rating =case_when( Protein_g ==0.00& Protein_g <=0.99~"Protein-free", Protein_g >=1& Protein_g <=15.99~"Low Protein", Protein_g >=16& Protein_g <=22.99~"Low Moderate Protein", Protein_g >=23& Protein_g <=38.99~" Moderate Protein", Protein_g >=39& Protein_g <=55.99~" Moderate High Protein", Protein_g >=56& Protein_g <=69.99~" High Protein", Protein_g >=70& Protein_g <=90.99~"Really High Protein", Protein_g >=91& Protein_g <=100~"All Proteins",TRUE~NA_character_ )) |>mutate(Carb_rating =case_when( Carbohydrt_g ==0.00& Carbohydrt_g <=0.99~"Carb-free", Carbohydrt_g >=1& Carbohydrt_g <=15.99~"Low Carb", Carbohydrt_g >=16& Carbohydrt_g <=22.99~"Low Moderate Carb", Carbohydrt_g >=23& Carbohydrt_g <=38.99~" Moderate Carb", Carbohydrt_g >=39& Carbohydrt_g <=55.99~" Moderate High Carb", Carbohydrt_g >=56& Carbohydrt_g <=69.99~" High Carb", Carbohydrt_g >=70& Carbohydrt_g <=90.99~"Really High Carb", Carbohydrt_g >=91& Carbohydrt_g <=100~"All Carbs",TRUE~NA_character_ )) #scaling Macros to fit into "level"
Foods that have a higher water content will keep you hydrated and usually comes in foods that are less in calorie, making them perfect for volume eating! This scatter plot breaks down all the items that fall into each category. Choosing Foods that are hydrating like fruits and vegetables will make for a happier diet.
Unfortunately, there is an issue sometimes with viewing the Tableau Viz when not logged into Tableau. Below will be a screenshot in case it is having issues.
An Ending Essay
Incorporating foods rich in protein and fiber into your eating habits is a smart strategy for maintaining a healthy diet and managing weight. “Protein’s ability to influence hormones that signal satiety to the brain is key in enhancing overall fullness” (Sutton). This makes meals rich in protein and fiber not only satisfying but also crucial in stabilizing blood sugar levels and reducing cravings for unhealthy snacks. Protein-rich foods, such as lean meats, fish, tofu, and legumes, are essential for building and repairing muscle, while fiber from fruits, vegetables, whole grains, and beans supports digestion and prolongs the feeling of fullness. By choosing meals that combine these two nutrients, you’re not only ensuring prolonged satiety but also making nutritious choices that support your overall health and well-being.
Mindful eating goes hand in hand with nutritional awareness, which is crucial when dining out. Having a good understanding of the macronutrients (such as protein, carbohydrates, and fats) in the foods you consume empowers you to make informed choices while still enjoying restaurant meals. By knowing the macros of your favorite dishes or ingredients, you can adjust your selections to align with your dietary goals. For instance, if you’re aiming to maintain a high-protein, low-carb diet, you can opt for grilled chicken or fish paired with a side of steamed vegetables instead of carb-heavy options. This level of awareness allows you to relish your dining experience without derailing your progress.
Research Source
Sutton, B. G. (2022). Nasm Essentials of Personal Fitness training. Jones & Bartlett Learning.