---
title: "Quantified Self Project"
author: "Huaxin Kang"
date: "February 20, 2018"
output:
flexdashboard::flex_dashboard:
orientation: columns
storyboard: true
vertical_layout: fill
social: menu
source_code: embed
---
```{r setup, include=FALSE, message=FALSE}
suppressPackageStartupMessages(suppressWarnings(library(tidyverse)))
suppressPackageStartupMessages(suppressWarnings(library(flexdashboard)))
suppressPackageStartupMessages(suppressWarnings(library(dplyr)))
suppressPackageStartupMessages(suppressWarnings(library(ggplot2)))
suppressPackageStartupMessages(suppressWarnings(library(dashboard)))
suppressPackageStartupMessages(suppressWarnings(library(knitr)))
ProjectData<-read.csv("C:/Users/kangj/Dropbox/HU/ANLY 512-90-Hitch/Personal Project/ProjectData.csv")
```
### Q1: Do I consistently keep active during the day instead of sitting for long hours?
```{r}
library(ggplot2)
ggplot(data=ProjectData)+aes(ProjectData$DayofWeek,ProjectData$Stand.Hours)+geom_bar(stat="identity", fill="Pink", color="Red")+ labs(title= 'Standing Hours by Day of the Week', x="Day of the Week", y='Total Standing Hours')
```
### Q2: On which days do I sleep the most?
```{r}
ggplot(data=ProjectData)+aes(ProjectData$DayofWeek,ProjectData$SleepHours)+geom_bar(stat="identity", color="white")+ labs(title= 'Sleeping Hours by Day of the Week', x="Day of the Week", y='Total Sleeping Hours')
```
### Q3: What's my calorie consumption over time?
```{r}
ProjectData$Date<-as.Date(ProjectData$Date)
ggplot(data=ProjectData, aes(x=Date, y=Active.Energy )) + geom_point(col="maroon") + geom_line(color = "red") + labs (title = "Active Energy by Date", x="Date", y="Active Energy (unit: Cal)") + theme(panel.background = element_rect(fill = "lightblue", colour = "lightblue", size = 0.5, linetype = "solid"), panel.grid.major = element_line(size = 0.5, linetype = 'solid', colour = "white"), panel.grid.minor = element_line(size = 0.25, linetype = 'solid', colour = "white"))
```
### Q4: Have I been drinking water consistenly?
```{r}
ggplot(data=ProjectData,aes(x=Date, y=Water))+xlab("Date")+ylab("Daily Water Consumption (unit: oz)")+geom_point(col="blue")+geom_line(col="sky blue")+ggtitle("Water Consumption by Date")
```
### Q5: Have I been doing a good job meditating every day?
```{r}
ggplot(data=ProjectData, aes(x = Meditation)) + geom_bar(fill="sky blue") + ggtitle("Count of Days With vs. Without Meditation")+ theme(panel.border = element_blank(), panel.grid.major = element_blank(),panel.grid.minor = element_blank())
```