This tool was created to help with diabetes management through lifestyle modifications of dietary intake. Based on a sample of dietary intake information, we completed a daily nutritent analysis focusing on protein, fibre and carbohydrate. This tool provided information on food groups to consumed daily and total daily protein, fibre and carbohydrate intake.
Standardized food group servings and completed nutrient analysis for protein, carbohydrates and fibre content.
Fruit and dairy food group were lacking in daily intake. Total fibre intake is below the recommendations of 25-50g per day. Grains and starches soley contributed to daily carbohydrate intake. Daily vegetables intake is inadequate. Protein intake from the meat and alternative food group is adequate.
Based on nutrient analysis, tailored nutrition recommendations can be provided. To obtain a balanced intake, inincreasing fibre intake from whole grains and vegetables and including fruit and dairy products is recommended.
HisData = read.csv("/Users/karensevong/Desktop/RExercise/HisFood.csv")
Conversion= read.csv("/Users/karensevong/Desktop/RExercise/FoodUnitConversion.csv")
FoodGroup= read.csv("/Users/karensevong/Desktop/RExercise/FoodtoFoodGroup.csv")
FoodtoCHO= read.csv("/Users/karensevong/Desktop/RExercise/FoodtoCHO.csv")
Nutrients= read.csv("/Users/karensevong/Desktop/RExercise/FoodtoNutrients.csv")
# HisData
HisData
## X Bread..slice. Egg..each. Jam..Tbsp. Butter..Tbsp. Vegetables..cups.
## 1 BF 2 2 1 1 0
## 2 AM 0 0 0 0 0
## 3 LU 0 0 0 0 2
## 4 PM 0 0 0 0 0
## 5 DN 0 0 0 0 1
## Chicken..oz. Dressing..Tbsp. Cookies..each. Corn..1.2.cup. Beef..oz.
## 1 0 0 0 0 0
## 2 0 0 0 0 0
## 3 6 3 0 0 0
## 4 0 0 3 0 0
## 5 0 0 0 1 6
# Conversion
Conversion
## X1 Bread..serving. Egg Jam Butter Raw.Vegetables
## 1 Bread (slice) 1 0.0 0 0 0
## 2 Egg (each) 0 0.5 0 0 0
## 3 Jam (Tbsp) 0 0.0 1 0 0
## 4 Butter (Tsp) 0 0.0 0 1 0
## 5 Raw Vegetables (cups) 0 0.0 0 0 1
## 6 Chicken (oz) 0 0.0 0 0 0
## 7 Dressing (Tbsp) 0 0.0 0 0 0
## 8 Cookies (each) 0 0.0 0 0 0
## 9 Corn ( 1/2 cup) 0 0.0 0 0 0
## 10 Beef (oz) 0 0.0 0 0 0
## Chicken Dressing Cookies Corn Beef
## 1 0.0000000 0 0.0 0 0.0000000
## 2 0.0000000 0 0.0 0 0.0000000
## 3 0.0000000 0 0.0 0 0.0000000
## 4 0.0000000 0 0.0 0 0.0000000
## 5 0.0000000 0 0.0 0 0.0000000
## 6 0.3333333 0 0.0 0 0.0000000
## 7 0.0000000 1 0.0 0 0.0000000
## 8 0.0000000 0 0.5 0 0.0000000
## 9 0.0000000 0 0.0 1 0.0000000
## 10 0.0000000 0 0.0 0 0.3333333
# FoodGroup
FoodGroup
## X1.serving Fruit Veg Grains.Starches Dairy Meat Fat
## 1 Bread (slice) 0 0 1 0 0 0
## 2 Egg (each) 0 0 0 0 1 0
## 3 Jam (Tbsp) 0 0 0 0 0 0
## 4 Butter (Tbsp) 0 0 0 0 0 1
## 5 Vegetables (cups) 0 1 0 0 0 0
## 6 Chicken (oz) 0 0 0 0 1 0
## 7 Dressing (Tbsp) 0 0 0 0 0 1
## 8 Cookies (each) 0 0 0 0 0 0
## 9 Corn (1/2 cup) 0 0 1 0 0 0
## 10 Beef (oz) 0 0 0 0 1 0
# FoodtoCHO
FoodtoCHO
## X CHO.serving
## 1 Fruit 15
## 2 Vegetable 0
## 3 Grains/Starches 15
## 4 Dairy 15
## 5 Meat 0
## 6 Fat 0
# Nutrients
Nutrients
## X Protein.serving CHO.serving Fibre.serving Fat.serving
## 1 Bread 0 15 2.0 0
## 2 Egg 14 0 0.0 0
## 3 Jam 0 15 0.0 0
## 4 Butter 0 0 0.0 4
## 5 Raw Vegetables 0 0 2.0 0
## 6 Chicken 25 0 0.0 0
## 7 Dressing 0 0 0.0 7
## 8 Cookies 0 15 0.0 8
## 9 Corn 0 15 1.7 0
## 10 Beef 25 0 0.0 0
This computation is based on recommendations from the Diabetes Food Guide, and current recommendations for protein and fibre intake. The reference for Diabetes clinical practice guidelines: http://guidelines.diabetes.ca/cpg.
HD<-as.matrix(HisData [c(1:5),c(2:11)])
Conv<-as.matrix(Conversion[c(1:10),c(2:11)])
HD%*%Conv->HDC
FG<-as.matrix(FoodGroup [c(1:10),c(2:7)])
HDF=HDC%*%FG
myfood <- as.data.frame(HDF)
CHO<-as.matrix(FoodtoCHO[c(1:6),2])
HDF%*%CHO
## [,1]
## 1 30
## 2 0
## 3 0
## 4 0
## 5 15
Nutr<-as.matrix(Nutrients[c(1:10),c(2:5)])
myfood <- as.data.frame(HDF)
myfood[nrow(myfood) + 1,] = colSums(myfood)
rownames(myfood) <- c("Breakfast","AM Snack","Lunch","PM Snack","Dinner","Daily Sum")
counts <- as.numeric(myfood[6,])
barplot(counts, main="Food Group Distribution", xlab="Type of Food Group",ylab="Number of Serving",col="blue",names.arg=c("Fruit","Vege","Grain","Dairy","Meat","Fat"))
# Total Daily Nutrient Intake
HDC%*%Nutr
## Protein.serving CHO.serving Fibre.serving Fat.serving
## 1 14 45.0 4.0 4
## 2 0 0.0 0.0 0
## 3 50 0.0 4.0 21
## 4 0 22.5 0.0 12
## 5 50 15.0 3.7 0
MyResults<-HDC%*%Nutr
myNu <- as.data.frame(MyResults)
myNu[nrow(myNu) + 1,] = colSums(myNu)
rownames(myNu) <- c("Breakfast","AM Snack","Lunch","PM Snack","Dinner","Daily Sum")
colnames(myNu) <- c("Protein","Carbohydrate","Fiber")
myNu
## Protein Carbohydrate Fiber NA
## Breakfast 14 45.0 4.0 4
## AM Snack 0 0.0 0.0 0
## Lunch 50 0.0 4.0 21
## PM Snack 0 22.5 0.0 12
## Dinner 50 15.0 3.7 0
## Daily Sum 114 82.5 11.7 37
counts <- as.numeric(myNu[6,])
barplot(counts, main="Nutrition Distribution", xlab="Type of Nutrition",ylab="Gram",ylim=c(0,120),col="Green",names.arg=c("Protein","Carbohydrate","Fiber", "Fat"))
summary(MyResults)
## Protein.serving CHO.serving Fibre.serving Fat.serving
## Min. : 0.0 Min. : 0.0 Min. :0.00 Min. : 0.0
## 1st Qu.: 0.0 1st Qu.: 0.0 1st Qu.:0.00 1st Qu.: 0.0
## Median :14.0 Median :15.0 Median :3.70 Median : 4.0
## Mean :22.8 Mean :16.5 Mean :2.34 Mean : 7.4
## 3rd Qu.:50.0 3rd Qu.:22.5 3rd Qu.:4.00 3rd Qu.:12.0
## Max. :50.0 Max. :45.0 Max. :4.00 Max. :21.0
totalProtein = sum(MyResults[,1])
# This is total grams of protein consumed per day
totalProtein
## [1] 114
kcalprotein<-totalProtein%*%4
# This is total calories coming from protein consumed per day
kcalprotein
## [,1]
## [1,] 456
totalCHO = sum(MyResults[,2])
# This is total grams of carbohydrates consumed per day
totalCHO
## [1] 82.5
kcalCHO<-totalCHO%*%4
# This is total calories coming from carbohydrates consumed per day
kcalCHO
## [,1]
## [1,] 330
totalFibre = sum(MyResults[,3])
# This is total grams of fibre consumed per day
totalFibre
## [1] 11.7
totalFat= sum(MyResults[,4])
# This is total grams of fat consumed per day
totalFat
## [1] 37
kcalFat<-totalFat%*%9
# This is total calories coming from fat consumed per day
kcalFat
## [,1]
## [1,] 333
FoodGroupResults<-HDF
summary(FoodGroupResults)
## Fruit Veg Grains.Starches Dairy Meat
## Min. :0 Min. :0.0 Min. :0.0 Min. :0 Min. :0
## 1st Qu.:0 1st Qu.:0.0 1st Qu.:0.0 1st Qu.:0 1st Qu.:0
## Median :0 Median :0.0 Median :0.0 Median :0 Median :1
## Mean :0 Mean :0.6 Mean :0.6 Mean :0 Mean :1
## 3rd Qu.:0 3rd Qu.:1.0 3rd Qu.:1.0 3rd Qu.:0 3rd Qu.:2
## Max. :0 Max. :2.0 Max. :2.0 Max. :0 Max. :2
## Fat
## Min. :0.0
## 1st Qu.:0.0
## Median :0.0
## Mean :0.8
## 3rd Qu.:1.0
## Max. :3.0
totalFruit= sum(FoodGroupResults[,1])
# This is total fruit serving consumed per day
totalFruit
## [1] 0
totalVeg= sum(FoodGroupResults[,2])
# This is total vegetable serving consumed per day
totalVeg
## [1] 3
totalGrains.Starches= sum(FoodGroupResults[,3])
# This is total grains and starches serving consumed per day
totalGrains.Starches
## [1] 3
totalDairy= sum(FoodGroupResults[,4])
# This is total grains and starches serving consumed per day
totalDairy
## [1] 0
totalMeat= sum(FoodGroupResults[,5])
# This is total grains and starches serving consumed per day
totalMeat
## [1] 5
totalFat= sum(FoodGroupResults[,6])
# This is total grains and starches serving consumed per day
totalFat
## [1] 4
barplot(counts*7, main="Estimated Nutrition Per Week", xlab="Type of Nutrition",ylab="Gram",ylim=c(0,1000),col="Green",names.arg=c("Protein","Carbohydrate","Fiber", "Fat"))
# Protein = bodyweight65 kg x 1.2 x7
# Carbohydrate = blood work Aic high => (150-240/day)
# sugar pair with protein(slow down release glauscos to blood stream )
# Fiber 45-50 for male x 7 , 21-38 for female x7
P= 65*1.2*7
C= 200*7
F = 47*7
est <- c(P,C,F)
total <- as.numeric(myNu[6,])
df = as.data.frame(cbind(est,total))
## Warning in cbind(est, total): number of rows of result is not a multiple of
## vector length (arg 1)
PJ=counts[1]*7
CJ=counts[2]*7
FJ=counts[3]*7
A = matrix(c(PJ,CJ,FJ,P,C,F),nrow=2, ncol=3,byrow = TRUE )
colnames(A)=c("Protein","Carbohydrate","Fiber")
rownames(A)=c("John","Recommend")
barplot(A, main="Estimated Nutrition Per Week",
xlab="Type of Nutrition", col=c("darkblue","red"),ylim=c(0,1600),
legend = rownames(A),beside=TRUE)
# Protein = 10-35% of total kcal
# Carbohydrate = 45-60% of total kcal
# Fat= 20-35% of total kcal
# linoleic acid= 5- 10% of total kcal
# alpha linolenic acid= 0.6- 1.2% of total kcal
# added sugars= <10% of total kcal
# sugar pair with protein(slow down release glucose to blood stream )
# Fiber 45-50 for male x 7 , 21-38 for female x7
P= 456/1119 *100
C= 330/1119 *100
Fat = 333/1119 *100
TKcal = 1119
est <- c(P,C,Fat)
total <- as.numeric(myNu[6,])
df = as.data.frame(cbind(est,total))
## Warning in cbind(est, total): number of rows of result is not a multiple of
## vector length (arg 1)
PJ=counts[1]*7
CJ=counts[2]*7
FJ=counts[3]*7
A = matrix(c(PJ,CJ,FJ,P,C,F),nrow=2, ncol=3,byrow = TRUE )
colnames(A)=c("Protein","Carbohydrate","Fat")
rownames(A)=c("John","Recommend")
barplot(A, main="Estimated Caloric Intake per day",
xlab="Type of Nutrition", col=c("darkblue","red"),ylim=c(0,1600),
legend = rownames(A),beside=TRUE)