Dasboard that give a guage/radar visualization of steps aggregate, daily average calories InTake and average sleep time over the course of time. A daily total target of 10,000 steps on average is to be attained and as summarized, a total of 265,400 steps out of 310,000 steps were completed in total time period. The Daily average of calories Intake is 1800 and average sleep time is 7.5 Hrs every night.
This is summary of the steps count achieved in 31 Days. the step plot is one of the variations of a line graph that shows nuances in the plot in a sharp lines.
This is a visualization for looking at the steps count that were attained and how weather conditions can impact the step counts one can achieve. a high step count variation can be seen for colder and moderate weather which makes it difficult to establish a direct proportional relationship between the enivronmental temperature of a place and Steps taken on a day. This can be expalined further in other visualizations to explain if other factors such as weekdays/weekends could also be an influencing factor.
This is as supplemetal to the visualization that was generated prior to see step count and weather condition proprotionality.
The Box plot and bar plots display the Weekday/Weekend relationship+ Weather conditions influencing the stepcount. Surprusingly, the analysis shows the step count aggregate is high on weekends which is also due to the fact that weekends had more moderate and cold weather days during the study time period. The extreme cold conidtions were more on weekdays which impacted the stepcount to greater degree.
This is area density plot which represents the Sleep time in hours over the study period. This is an interactive plot which would give th eprecise data when the pointer is slid over the edges of the plot. On average, the fitness experts have recommended atleast 7 hours of sleep everynight. Sleep is an activity that cannot be averaged to make up for lost sleep to have a good health and physical mental fitness.
This is an outline of sedentary minutes which is accounted for timeof no activity when awake. As a previous analogy, i have extrapolated the Sedntary minutes with the weather conditions to see if more sedentary minutes are seen for cold weather. the average sedentary minutes during the time period was around 790 minutes which is ~13 Hours each day. So, it can be said that the sedentary minutes are lower and close to average for moderate and cold weather. It was also seen that, even on a very chilly weather day, the sedentary minutes was in a average range.
This is plot to visualize the realtionship between the Calorie Intake and Calories Burned. It can be said from the plot that there is a linear relationship between the Calorie Intake and Calories Burned which is a good relationship and allows metabolic rate to remain high.
The calorie Intake and Calories Burned are plotted against the stepcount. which explains the stepcount and Calories Burned realtionship. This is a good example for Calories Burned against the stepcount and calorie Intake which helps track our fitness on average and keeping a steady and healthy lifestyle.
---
title: "ANLY 512 Final Project: Quanitifed Fit Data"
author: "Mohammed Junaid Asif"
output:
flexdashboard::flex_dashboard:
social: menu
source: embed
storyboard: true
orientation: columns
vertical_layout: fill
---
```{r message=FALSE, warning=FALSE}
library(ggplot2)
library(dygraphs)
library(ggalt)
library(flexdashboard)
library(dplyr)
library(xts)
library(zoo)
library(readxl)
library(lubridate)
library(lattice)
library(plotly)
library(iplots)
library(ggthemes)
library(reshape2)
```
```{r}
FitData1 <- read_excel("C:/Users/kzlc665/Documents/HBU/512/FitData_1.xlsx")
FitData1$Date <- ymd(FitData1$Date)
```
Fitness Dashborad
=========================================
-----------------------------------------------------------------------
### Total Step Count
```{r message=FALSE, warning=FALSE}
steps.gauage <- gauge(sum(FitData1$Steps), min = 0, max =10000*(nrow(FitData1)) , gaugeSectors(success = NULL, warning = NULL, danger = NULL, colors = c("success", "warning", "danger")))
steps.gauage
```
### Average Calorie Intake
```{r message=FALSE, warning=FALSE}
calories.gauge <- gauge(mean(FitData1$`Calories Intake`,label = "Calories Intake"), min = 1000, max= 2050, gaugeSectors(success = NULL, warning = NULL, danger = NULL,
colors = c("success", "warning", "danger")))
calories.gauge
```
### Average Sleep/Night
```{r}
sleep.gauge <- gauge(round(mean(FitData1$`Sleep(in Hours)`, symbol = 'Hrs', label = "sleep/Night"), digits=1), min = 6, max = 8, gaugeSectors(success = NULL, warning = NULL, danger = NULL,
colors = c("success", "warning", "danger")))
sleep.gauge
```
***
Dasboard that give a guage/radar visualization of steps aggregate, daily average calories InTake and average sleep time over the course of time.
A daily total target of 10,000 steps on average is to be attained and as summarized, a total of 265,400 steps out of 310,000 steps were completed in total time period.
The Daily average of calories Intake is 1800 and average sleep time is 7.5 Hrs every night.
Quantified Fitness Visualizations {.storyboard}
=========================================
### Step Count Summary {}
```{r message=FALSE, warning=FALSE}
step.plot <- ggplot(FitData1, aes(Date, Steps))+geom_step(color = "yellow")+ geom_point(aes(text = paste("Date/Temp.:", FitData1$Date, FitData1$`Weather Hi`)), size = 4)+theme_dark()
step.plot <- ggplotly(step.plot)
step.plot
```
***
This is summary of the steps count achieved in 31 Days. the step plot is one of the variations of a line graph that shows nuances in the plot in a sharp lines.
### Step Count vs Weather Condition {}
```{r message=FALSE, warning=FALSE}
options(warn = -1)
p <- ggplot(data = FitData1, aes(Date,Steps,colour = FitData1$`Weather Condition`)) +
geom_point(aes(text = paste("Date/Temp.:", FitData1$Date, FitData1$`Weather Hi`)), size = 4) +
geom_smooth(se=FALSE, method="loess",aes( colour = FitData1$`Weather Condition` , fill = FitData1$`Weather Condition`))+guides(fill=guide_legend(title="Weather Condition"))+theme_bw()
ggplotly(p)
```
***
This is a visualization for looking at the steps count that were attained and how weather conditions can impact the step counts one can achieve. a high step count variation can be seen for colder and moderate weather which makes it difficult to establish a direct proportional relationship between the enivronmental temperature of a place and Steps taken on a day. This can be expalined further in other visualizations to explain if other factors such as weekdays/weekends could also be an influencing factor.
### Weather Condition
```{r}
ggplot(FitData1, aes(x=FitData1$`Weather Condition`, y=FitData1$Steps, fill=FitData1$`Weather Condition`)) + geom_bar(stat="identity")+ scale_fill_discrete(name="Weather Cond")+labs(x="Weather Condition", y="Steps")+theme_few()
```
***
This is as supplemetal to the visualization that was generated prior to see step count and weather condition proprotionality.
### Step Count vs Weekdays/Weekends {}
```{r}
# Stacked Bar Plot with Colors and Legend
ggplot(FitData1)+ geom_boxplot(aes(FitData1$`Weekday/Weekend`,FitData1$Steps), fill = "maroon")+labs(title="Steps vs Weekday/Weekend",x="Weekday/Weekend", y="Steps")+theme_economist()
ggplot(FitData1, aes(FitData1$`Weekday/Weekend`)) + geom_bar(aes(fill = FitData1$`Weather Condition`)) + scale_fill_discrete(name="Weather Cond")+ labs(x="Weekday/Weekend", title="Weather conditions prevailing on Weekdays/Weekends")+theme_calc()
```
***
The Box plot and bar plots display the Weekday/Weekend relationship+ Weather conditions influencing the stepcount. Surprusingly, the analysis shows the step count aggregate is high on weekends which is also due to the fact that weekends had more moderate and cold weather days during the study time period. The extreme cold conidtions were more on weekdays which impacted the stepcount to greater degree.
### Sleep Activity {}
```{r message=FALSE}
sleep.plot <- ggplot(FitData1,aes(FitData1$Date,FitData1$`Sleep(in Hours)`))+labs(x="Date",y="Sleep Time Night(in Hours)")+ggtitle("Sleep Every Night ")+ geom_area( fill= "red", alpha = 0.3 )+theme_hc()
ggplotly(sleep.plot)
```
***
This is area density plot which represents the Sleep time in hours over the study period. This is an interactive plot which would give th eprecise data when the pointer is slid over the edges of the plot. On average, the fitness experts have recommended atleast 7 hours of sleep everynight. Sleep is an activity that cannot be averaged to make up for lost sleep to have a good health and physical mental fitness.
### Sedentary Minutes vs Weather Conditions
```{r message=FALSE}
seden <- ggplot(FitData1, aes(FitData1$`Minutes Sedentary`, fill = FitData1$`Weather Condition`)) +
geom_histogram(binwidth=250)+labs(x="Sedentary Minutes")
seden
seden1 <- ggplot(FitData1, aes(FitData1$Date, FitData1$`Minutes Sedentary`), colour="blue")+labs(x="Date", y="Sendetary Minutes")+geom_line()+theme_light()
```
***
This is an outline of sedentary minutes which is accounted for timeof no activity when awake. As a previous analogy, i have extrapolated the Sedntary minutes with the weather conditions to see if more sedentary minutes are seen for cold weather. the average sedentary minutes during the time period was around 790 minutes which is ~13 Hours each day. So, it can be said that the sedentary minutes are lower and close to average for moderate and cold weather. It was also seen that, even on a very chilly weather day, the sedentary minutes was in a average range.
### Calories Intake vs Calories Burned
```{r message=FALSE}
calplot <- ggplot(FitData1,aes(FitData1$`Calories Intake`,FitData1$`Calories Burned`))+labs(x="Calories Intake",y="Calories Burned")+ggtitle("Calories Comparison")+geom_point()+geom_smooth(method="lm")+theme_minimal()
ggplotly(calplot)
```
***
This is plot to visualize the realtionship between the Calorie Intake and Calories Burned. It can be said from the plot that there is a linear relationship between the Calorie Intake and Calories Burned which is a good relationship and allows metabolic rate to remain high.
### calories Intake/calories Burned vs Steps
```{r}
Cal.data <- data.frame(FitData1$Steps,FitData1$`Calories Burned`,FitData1$`Calories Intake`)
test_cal <- melt(Cal.data, id.vars = 1)
```
```{r message=FALSE, warning=FALSE}
cald.plot <- ggplot(test_cal,aes(test_cal$FitData1.Steps,test_cal$value, colour=variable))+labs(x="Steps", y="Calories Intake/Burned", title="Calorie Intake/Burned vs Steps")+guides(fill=guide_legend(title=NULL))+geom_point()+scale_fill_discrete(breaks=c("calories Burned","Calories Intake"))+theme_calc()
ggplotly(cald.plot)
```
***
The calorie Intake and Calories Burned are plotted against the stepcount. which explains the stepcount and Calories Burned realtionship. This is a good example for Calories Burned against the stepcount and calorie Intake which helps track our fitness on average and keeping a steady and healthy lifestyle.