The Quantified Self (QS) is a movement to exploits the ease and convenience of data acquisition through the internet of things (IoT) to feed the growing obsession of personal informatics and quotidian data.
In this project, the dataset is a original created dataset about my personal life. I started my diet plan about 3 month ago, and have been self-record my daily activity from that time. My goal is to loos weight and be fit in a healthy way. So the activities were adjust from time to time. In another word, I did not do all activities from the first day I record the data. I constantly add new activities in my plan, and also this diet plan is depends on a lot of factors in my personal life. For example, the whole day hiking activity was not a daily training plan, it was only recorded from my one week vacation at Zion National park. Similarly, I took breaks from time to time over the three month, so the diet plan has some missing values as well. Therefore, the visualization of the dataset might not be very pretty and perfect.
This self-record diet plan has a range from 2018-08-06 to 2018-10-06;consist total of 3 months. The variables can be classified into the following categories: (i) Date (ii) Weight(lb) (iii) Waistline(cm) (iv) Calories take in each day (v) Hours of sleep (vi)Runing in minutes (vii) Hiking in minutes (viii) Rope skipping in minutes (ix) Yoga in minutes (x) Water drink in Liters. And the missing value has been replaced with 0 in this dataset.
I used ggplot2 to visualize the data, and used the flexdashboard to have the visualization presents in the way of dashboard. And I did analysis on all interesting variables that I think is having some impact with the weight loss. The graph includes barplot, boxplot,and lineplot.
How many pounds I loose in over three months?
What is the min and the max minutes I worked out per day?
Does the increasing in minutes of working out affect rapid weight loose?
Does the calories takes in each day greatly affect weight loose?
Does the hour of sleep affect rapid weight loose?
Does duration of workout affect water drinking per day?
This is a overall graph showing my diet plan is actually very successful. We can see from the graph that both weight in pounds and waistline in centimeters has been decreasing during these three month.
1.How many pounds I loose in over three months?
From the graph above we know that the max weight is 120lb occur on Aug.6th, 2018, and the mix weight is 101lb occur on Oct.6th. So we use the max - min = 120 - 101, which is 19lb. So that means I have been loosing 19lb over three months.
2. What is the min and the max minutes I worked out per day?
The above graph give me the four different types of exercise in minutes I did during the three month period, including running, ropeskipping, yoga, and hiking. Since I did take breaks over the three month, so the min is 0. And to find the max minutes I worked out is actually very interesting. We notice that I actually did combinations of different exercises a lot of times. We can try add those minutes up across different type of exercise. For example, I ran 40 minutes, rope skipping for 30 minutes, and also did yoga for 30 minutes, adding those up is 100 minutes a day, that looks a lot. However, let’s looking at the very last box plot, which showing the category of hiking, even it is only one exercise, but in the graph it showing I was doing it for 480 minutes,so that is the max. Therefore, the max I worked out in one day is 480 minutes, and the min is 0 minutes.
3. Does the increasing in minutes of working out affect rapid weight loose?
This is actually very hard to see from the graph, we can compare the weight loose graph with the exercise in minutes graph, if we check the increasing minutes in working out compare with the weight loose in pounds, it does not show a rapid drop on weight. So I would say the increasing working out minutes does not neccessary result a greater weight loose, but it still does have some effect.
4. Does the calories takes in each day greatly affect weight loose?
From the graph above, we can see the calories takes in each day differently affect weight loose, however, it does not has that great of affect on weight loose as well, it is only one of the factors.
5. Does the hour of sleep affect rapid weight loose?
From the graph above, it showing I have a pretty blanced hours of sleep, the mean is 8.5 hour over the three month, and most of the day I have 8 hours of sleep. So it we can not really have a conclusion of if it does affect weight loose from this graph.
6. Does duration of workout affect water drinking per day?
Yes. We can clear see it from the graph that at the max minutes work out I drank more water than usual. Normally, I drink about 2 Liters per day. And at the days I worked out for over 400 minutes I drink 4 Liters instead.
So From the visualizations, we can conclude that there is a lot of factors that affect the weight loosing. They are affect weight loosing in different aspect. One thing I learnt from this project is that doing only one activities above does not necessary have a major impact on changing the overall weight. We need to have a good balance of doing most of these things in a good time manner in order to successfully loosing weight and be fit.
---
title: "Final Project"
author: "Jingshu Zhao"
date: "October 6, 2018"
#output: flexdashboard::flex_dashboard
output:
flexdashboard::flex_dashboard:
vertical_layout: fill
source: embed
---
```{r message=FALSE, warning=FALSE}
library(flexdashboard)
library(ggplot2)
library(reshape2)
library(tidyquant)
```
Background {data-orientation=rows}
=====================================================================
Row
---------------------------------------------------------
### Introduction
The Quantified Self (QS) is a movement to exploits the ease and convenience of data acquisition through the internet of things (IoT) to feed the growing obsession of personal informatics and quotidian data.
In this project, the dataset is a original created dataset about my personal life. I started my diet plan about 3 month ago, and have been self-record my daily activity from that time. My goal is to loos weight and be fit in a healthy way. So the activities were adjust from time to time. In another word, I did not do all activities from the first day I record the data. I constantly add new activities in my plan, and also this diet plan is depends on a lot of factors in my personal life. For example, the whole day hiking activity was not a daily training plan, it was only recorded from my one week vacation at Zion National park. Similarly, I took breaks from time to time over the three month, so the diet plan has some missing values as well. Therefore, the visualization of the dataset might not be very pretty and perfect.
This self-record diet plan has a range from 2018-08-06 to 2018-10-06;consist total of 3 months. The variables can be classified into the following categories: (i) Date (ii) Weight(lb) (iii) Waistline(cm) (iv) Calories take in each day (v) Hours of sleep (vi)Runing in minutes (vii) Hiking in minutes (viii) Rope skipping in minutes (ix) Yoga in minutes (x) Water drink in Liters. And the missing value has been replaced with 0 in this dataset.
Row
---------------------------------------------------------
### Tools
I used ggplot2 to visualize the data, and used the flexdashboard to have the visualization presents in the way of dashboard. And I did analysis on all interesting variables that I think is having some impact with the weight loss. The graph includes barplot, boxplot,and lineplot.
Row
---------------------------------------------------------
### Outline Questions
1. How many pounds I loose in over three months?
2. What is the min and the max minutes I worked out per day?
3. Does the increasing in minutes of working out affect rapid weight loose?
4. Does the calories takes in each day greatly affect weight loose?
5. Does the hour of sleep affect rapid weight loose?
6. Does duration of workout affect water drinking per day?
Overview {data-orientation=rows}
=====================================================================
Row {data-height=850}
-----------------------------------------------------------------------
### Weight in lb
```{r message=FALSE, warning=FALSE}
diet <- read.csv("/Users/jings/OneDrive/Documents/fennoy/personaldiet.csv",stringsAsFactors = F)
diet <- diet %>% mutate(Date = row_number())
ggplot(data=diet, aes(x=diet$Date, group=1)) + geom_line(aes(y=diet$Weight.lb., color='red')) + geom_line(aes(y=diet$Waistline.CM., color='blue'))+
labs (title = "Diet Plan Result", x="Date", y="Weight(lb) and waistline(cm)") + scale_colour_discrete(name ="Result",
breaks=c("blue", "red"),labels=c("Waistline(cm)", "Weight(lb)"))
```
Row {data-height=150}
-----------------------------------------------------------------------
This is a overall graph showing my diet plan is actually very successful. We can see from the graph that both weight in pounds and waistline in centimeters has been decreasing during these three month.
```{r}
diet <- read.csv("/Users/jings/OneDrive/Documents/fennoy/personaldiet.csv",stringsAsFactors = F)
#diet
#glimpse(diet)
#summary(diet)
```
Pounds {data-orientation=rows}
====================================================
Row {data-height=850}
-----------------------------------------------------------------------
### How many pounds I loose in over three months?
```{r message=FALSE, warning=FALSE}
diet <- diet %>% mutate(Date = row_number())
ggplot(data=diet, aes(x=diet$Date, y=diet$Weight.lb., group=1)) + geom_line(color = "purple") +
labs (title = "Weight change by date (date range (2018-08-06, 2018-10-06))", x="Date", y="Weight(lb)")
```
Row {data-height=150}
-----------------------------------------------------------------------
**1.How many pounds I loose in over three months?**
From the graph above we know that the max weight is 120lb occur on Aug.6th, 2018, and the mix weight is 101lb occur on Oct.6th. So we use the max - min = 120 - 101, which is 19lb. So that means I have been loosing 19lb over three months.
Working Minutes {data-orientation=rows}
====================================================
Row {data-height=850}
-----------------------------------------------------------------------
### What is the min and the max minutes I worked out per day?
```{r message=FALSE, warning=FALSE}
diet.m <- melt(diet,Date.vars='Date', measure.vars=c('Run.M.','Ropeskipping.M.','yoga.M.','Hiking.M.'))
ggplot(diet.m) + geom_boxplot(aes(x=Date, y=value, color=variable))+
labs (title = "Different Type of Work Out in minutes", y="Minutes", x="work out type")
```
Row {data-height=150}
-----------------------------------------------------------------------
**2. What is the min and the max minutes I worked out per day?**
The above graph give me the four different types of exercise in minutes I did during the three month period, including running, ropeskipping, yoga, and hiking. Since I did take breaks over the three month, so the min is 0. And to find the max minutes I worked out is actually very interesting.
We notice that I actually did combinations of different exercises a lot of times. We can try add those minutes up across different type of exercise. For example, I ran 40 minutes, rope skipping for 30 minutes, and also did yoga for 30 minutes, adding those up is 100 minutes a day, that looks a lot. However, let's looking at the very last box plot, which showing the category of hiking, even it is only one exercise, but in the graph it showing I was doing it for 480 minutes,so that is the max. Therefore, the max I worked out in one day is 480 minutes, and the min is 0 minutes.
Working Time {data-orientation=rows}
====================================================
Row {data-height=850}
-----------------------------------------------------------------------
### Does the increasing in minutes of working out affect rapid weight loose?
```{r message=FALSE, warning=FALSE}
require(gridExtra)
diet <- diet %>% mutate(Date = row_number())
plot1 <- ggplot(data=diet, aes(x=diet$Date, y=diet$Weight.lb., group=1)) + geom_line(color = "purple") +
labs (title = "Weight change", x="Date", y="Weight(lb)")
plot2 <- ggplot(diet.m) + geom_boxplot(aes(x=Date, y=value, color=variable))+
labs (title = "Type of Work Out", y="Minutes", x="work out type")
grid.arrange(plot1, plot2, ncol=2)
```
Row {data-height=150}
-----------------------------------------------------------------------
**3. Does the increasing in minutes of working out affect rapid weight loose?**
This is actually very hard to see from the graph, we can compare the weight loose graph with the exercise in minutes graph, if we check the increasing minutes in working out compare with the weight loose in pounds, it does not show a rapid drop on weight. So I would say the increasing working out minutes does not neccessary result a greater weight loose, but it still does have some effect.
Calories {data-orientation=rows}
====================================================
Row {data-height=850}
-----------------------------------------------------------------------
### Does the calories takes in each day greatly affect weight loose?
```{r message=FALSE, warning=FALSE}
diet <- diet %>% mutate(Date = row_number())
ggplot(data=diet, aes(x=diet$Date, y=diet$Carlories)) +
geom_bar(stat="identity",color="orange")+
labs (title = "Calories take in by day", x="Date(0 represent 2018-08-06)", y="Calories")
```
Row {data-height=150}
-----------------------------------------------------------------------
**4. Does the calories takes in each day greatly affect weight loose?**
From the graph above, we can see the calories takes in each day differently affect weight loose, however, it does not has that great of affect on weight loose as well, it is only one of the factors.
Sleep {data-orientation=rows}
====================================================
Row {data-height=850}
-----------------------------------------------------------------------
### Does the hour of sleep affect rapid weight loose?
```{r message=FALSE, warning=FALSE}
ggplot(diet, aes(x=diet$Date, y=diet$Sleep.H.)) +
geom_boxplot(fill='#E69F00', color="purple")+ coord_flip()+
labs (title = "Hour of Sleep by day", x="Date(0 represent 2018-08-06)", y="Hours of Sleep")
```
Row {data-height=150}
-----------------------------------------------------------------------
**5. Does the hour of sleep affect rapid weight loose?**
From the graph above, it showing I have a pretty blanced hours of sleep, the mean is 8.5 hour over the three month, and most of the day I have 8 hours of sleep. So it we can not really have a conclusion of if it does affect weight loose from this graph.
Water {data-orientation=rows}
====================================================
Row {data-height=850}
-----------------------------------------------------------------------
### Does duration of workout affect water drinking per day?
```{r message=FALSE, warning=FALSE}
ggplot(diet, aes(diet$Date, y=diet$WaterDrink.L.)) +
geom_bar(stat = "identity", color = 'Green')+ coord_flip()+
labs (title = "Water drink by day", x="Date(0 represent 2018-08-06)", y="Water drink in Liter")
```
Row {data-height=150}
-----------------------------------------------------------------------
**6. Does duration of workout affect water drinking per day?**
Yes. We can clear see it from the graph that at the max minutes work out I drank more water than usual. Normally, I drink about 2 Liters per day. And at the days I worked out for over 400 minutes I drink 4 Liters instead.
Conclusion {data-orientation=rows}
====================================================
Row {data-height=850}
-----------------------------------------------------------------------
### Conclusion:
So From the visualizations, we can conclude that there is a lot of factors that affect the weight loosing. They are affect weight loosing in different aspect. One thing I learnt from this project is that doing only one activities above does not necessary have a major impact on changing the overall weight. We need to have a good balance of doing most of these things in a good time manner in order to successfully loosing weight and be fit.