Under the Quantified self-knowledge, we decided to look at our daily food consumption. The data collected includes food consumed by the 3 project partners from 7/1/2020 to 7/7/2020. This data includes few major components like the portion, Calories, Protein, Fat, Saturated Fat, Fiber, Carbs, Category.
The goal for this data collection is to see how our daily food consumption compare to each other as well as the medically accepted standard for humans our age.
There are 5 major questions that we aim to answer during this project. These questions maybe changed over the course of the project if we believe there are more pertinent questions that need to be answered.
How does our daily calorie intake compare with each other?
How does our calorie intake compare with the medically accepted standard?
Are we getting enough protein in our diet?
What is the most common food category that is consumed? Is it a healthy or unhealthy choice?
Are we consuming too much fats and saturated fats?
Answering these questions will help us understand a great deal about our dietary habits and may also result in recommending a change if required.
Each one of us recorded our food consumption for a week. We then matched the nutrient specifications of the food from online resources.
We aggregated the data for daily intake and grouped them by eac person. Since this was manually recorded data, there were no missing values.
The following data analysis and visualizations would help in proper consumption of overall macro-nutrients by individuals. The results observed would help in individual’s mindfulness in nutrition consumption everyday changing food consumption patterns.
The appropriate average calorie intake of human-beings must be in between 1800 to 2400 calories a day and we can conclude that there are some irregularities in consumption of calories like July 5th on a day to day basis from individual to individual.
In the first days of the week, individuals are consuming very less while on the end of the week they are consuming more. However, from the total consumption of calories, the individuals can track the patterns for consumption of calories and eat mindfully.
In detailed analysis, we get to analyze each and every factor(macronutrients) of the calorie intake of individuals like Proteins, Fats contents alongside with reference to what category of foods consumed.
The first section of graphs attempts to track the daily calorie intake by each person as well as how we compare to each other.
A similar approach to the protiens is also done in the second section.
In the third section we plot a scatter plot for calorie vs fats to see how much of our calories are coming from fats. This is grouped in color and shape based on names. It gives us a quick representation of who has a healthier fat intake on which day.
The last graph shows the variety of food products each individual has consumed. Dairy products and meat is the highest consumed amongst all three. This can be indicative of the high fat and calorie intake.
---
title: "ANLY512_Project"
author: "Kowshik Kumar B; Mrugank Pratap Salunke; Deepika Grover"
output:
flexdashboard::flex_dashboard:
orientation: columns
social: [ "menu" ]
source: embed
vertical_layout: scroll
---
```{r setup, include=FALSE}
library(flexdashboard)
library(dygraphs)
library(pdfetch)
library(ggplot2)
library(timeSeries)
library(gridExtra)
library(scales)
library(Quandl)
library(quantmod)
library(sqldf)
library(fBasics)
library(evir)
library(TH.data)
library(shiny)
#library(tidyverse)
library(tidyquant)
#library(timetk)
library(readr)
library(dplyr)
all_nutrients <- read_csv("C:/Users/Mrugank/Downloads/nutrients_daily_data.csv",
col_types = cols(Calories = col_number(),
Carbs = col_number(), Date = col_date(format = "%m/%d/%Y"),
Fiber = col_number(), Grams = col_number(),
Protein = col_number()))
mrugank_nutrients<-sqldf("select * from all_nutrients where Name='Mrugank'")
kaushik_nutrients<-sqldf("select * from all_nutrients where Name='Kaushik'")
deepika_nutrients<-sqldf("select * from all_nutrients where Name='Deepika'")
```
Summary
===========
#### **ANLY 512 - The Quantified Self**
Under the Quantified self-knowledge, we decided to look at our daily food consumption. The data collected includes food consumed by the 3 project partners from 7/1/2020 to 7/7/2020.
This data includes few major components like the portion, Calories, Protein, Fat, Saturated Fat, Fiber, Carbs, Category.
The goal for this data collection is to see how our daily food consumption compare to each other as well as the medically accepted standard for humans our age.
There are 5 major questions that we aim to answer during this project. These questions maybe changed over the course of the project if we believe there are more pertinent questions that need to be answered.
1) How does our daily calorie intake compare with each other?
2) How does our calorie intake compare with the medically accepted standard?
3) Are we getting enough protein in our diet?
4) What is the most common food category that is consumed? Is it a healthy or unhealthy choice?
5) Are we consuming too much fats and saturated fats?
Answering these questions will help us understand a great deal about our dietary habits and may also result in recommending a change if required.
#### Following is how we conducted this analysis
* Each one of us recorded our food consumption for a week. We then matched the nutrient specifications of the food from online resources.
* We aggregated the data for daily intake and grouped them by eac person. Since this was manually recorded data, there were no missing values.
* The following data analysis and visualizations would help in proper consumption of overall macro-nutrients by individuals. The results observed would help in individual's mindfulness in nutrition consumption everyday changing food consumption patterns.
* The appropriate average calorie intake of human-beings must be in between 1800 to 2400 calories a day and we can conclude that there are some irregularities in consumption of calories like July 5th on a day to day basis from individual to individual.
* In the first days of the week, individuals are consuming very less while on the end of the week they are consuming more. However, from the total consumption of calories, the individuals can track the patterns for consumption of calories and eat mindfully.
* In detailed analysis, we get to analyze each and every factor(macronutrients) of the calorie intake of individuals like Proteins, Fats contents alongside with reference to what category of foods consumed.
* The first section of graphs attempts to track the daily calorie intake by each person as well as how we compare to each other.
* A similar approach to the protiens is also done in the second section.
* In the third section we plot a scatter plot for calorie vs fats to see how much of our calories are coming from fats. This is grouped in color and shape based on names. It gives us a quick representation of who has a healthier fat intake on which day.
* The last graph shows the variety of food products each individual has consumed. Dairy products and meat is the highest consumed amongst all three. This can be indicative of the high fat and calorie intake.
# Calories Intake
Column {.tabset}
-----------------------------------------------------------------------
### Calorie Comparison
```{r fig.height = 7.5, fig.width = 10}
sum_cal <- all_nutrients%>%
group_by(Date, Name)%>%
summarise(total_cal = sum(Calories))
mrugank_cal<-sqldf("select * from sum_cal where Name='Mrugank'")
kaushik_cal<-sqldf("select * from sum_cal where Name='Kaushik'")
deepika_cal<-sqldf("select * from sum_cal where Name='Deepika'")
ggplot(sum_cal,aes(x=Date,y=total_cal,colour=Name,group=Name)) +
geom_line() +
ylab("Total Calories") +
ggtitle("Total Calorie Consumption Comparison")
```
### Mrugank's
```{r fig.height = 7.5, fig.width = 10}
ggplot(mrugank_cal) +
aes(mrugank_cal$Date, mrugank_cal$total_cal) +
geom_bar(stat = "identity", color = 'Yellow') +
ggtitle("Frequency for Mrugank's daily intake of calories")+
xlab("Date")+
ylab("Number of Calories")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
### Kaushik's
```{r fig.height = 7.5, fig.width = 10}
ggplot(kaushik_cal) +
aes(kaushik_cal$Date, kaushik_cal$total_cal) +
geom_bar(stat = "identity", color = 'blue') +
ggtitle("Frequency for Kaushik's daily intake of calories")+
xlab("Date")+
ylab("Number of Calories")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
### Deepika's
```{r fig.height = 7.5, fig.width = 10}
ggplot(deepika_cal) +
aes(deepika_cal$Date, deepika_cal$total_cal) +
geom_bar(stat = "identity", color = 'green') +
ggtitle("Frequency for Deepika's daily intake of calories")+
xlab("Date")+
ylab("Number of Calories")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
# Protiens Intake
Column {.tabset}
-----------------------------------------------------------------------
### Protien Comparison
```{r fig.height = 7.5, fig.width = 10}
sum_pro <- all_nutrients%>%
group_by(Date, Name)%>%
summarise(total_pro = sum(Protein))
mrugank_pro<-sqldf("select * from sum_pro where Name='Mrugank'")
kaushik_pro<-sqldf("select * from sum_pro where Name='Kaushik'")
deepika_pro<-sqldf("select * from sum_pro where Name='Deepika'")
ggplot(sum_pro,aes(x=Date,y=total_pro,colour=Name,group=Name)) +
geom_line() +
ylab("Total Protien") +
ggtitle("Total Protien Consumption Comparison")
```
### Mrugank's
```{r fig.height = 7.5, fig.width = 10}
ggplot(mrugank_pro) +
aes(mrugank_pro$Date, mrugank_pro$total_pro) +
geom_bar(stat = "identity", color = 'Yellow') +
ggtitle("Frequency for Mrugank's daily intake of Protiens")+
xlab("Date")+
ylab("Number of Protiens")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
### Kaushik's
```{r fig.height = 7.5, fig.width = 10}
ggplot(kaushik_pro) +
aes(kaushik_pro$Date, kaushik_pro$total_pro) +
geom_bar(stat = "identity", color = 'blue') +
ggtitle("Frequency for Kaushik's daily intake of Protiens")+
xlab("Date")+
ylab("Number of Protiens")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
### Deepika's
```{r fig.height = 7.5, fig.width = 10}
ggplot(deepika_pro) +
aes(deepika_pro$Date, deepika_pro$total_pro) +
geom_bar(stat = "identity", color = 'green') +
ggtitle("Frequency for Deepika's daily intake of Protiens")+
xlab("Date")+
ylab("Number of Protiens")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
# Fats Intake
Column {.tabset}
-----------------------------------------------------------------------
### Fat Comparison
```{r fig.height = 7.5, fig.width = 10}
sum_fat <- all_nutrients%>%
group_by(Date, Name)%>%
summarise(total_fat = sum(Fat), total_cal = sum(Calories))
mrugank_fat<-sqldf("select * from sum_fat where Name='Mrugank'")
kaushik_fat<-sqldf("select * from sum_fat where Name='Kaushik'")
deepika_fat<-sqldf("select * from sum_fat where Name='Deepika'")
ggplot(sum_fat, aes(x=total_fat, y=total_cal, shape=Name, color=Name, size = 5)) +
geom_point()+
xlab("Total Fat") +
ylab("Total Calorie") +
ggtitle("Total Fat Consumption Compared by Calories")
```
### Mrugank's
```{r fig.height = 7.5, fig.width = 10}
ggplot(mrugank_fat) +
aes(mrugank_fat$Date, mrugank_fat$total_fat) +
geom_bar(stat = "identity", color = 'Yellow') +
ggtitle("Frequncy for Mrugank's daily intake of Fats")+
xlab("Date")+
ylab("Number of Fats")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
### Kaushik's
```{r fig.height = 7.5, fig.width = 10}
ggplot(kaushik_fat) +
aes(kaushik_fat$Date, kaushik_fat$total_fat) +
geom_bar(stat = "identity", color = 'blue') +
ggtitle("Frequncy for Kaushik's daily intake of Fats")+
xlab("Date")+
ylab("Number of Fats")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
### Deepika's
```{r fig.height = 7.5, fig.width = 10}
ggplot(deepika_fat) +
aes(deepika_fat$Date, deepika_fat$total_fat) +
geom_bar(stat = "identity", color = 'green') +
ggtitle("Frequncy for Deepika's daily intake of Fats")+
xlab("Date")+
ylab("Number of Fats")+
theme(axis.text.x=element_text(angle=60, hjust=1))
```
# Category of foods consumed
Column {data-width=600}
-----------------------------------------------------------------------
```{r fig.height = 7.5, fig.width = 15}
ggplot(all_nutrients, aes(x = Category, color = Name)) + geom_bar()
```