| Metric | Value |
|---|---|
| Total Workouts | 15000 |
| Avg Calories Burned | 89.5 |
| Avg Duration (min) | 15.5 |
| Avg Heart Rate (bpm) | 96 |
Research Questions:
This fitness dashboard analyzes workout data to answer five key questions:
Efficiency Question: What factors most strongly predict calorie burn during workouts?
Optimization Question: Which workout duration and intensity combinations are most effective for calorie burning?
Demographic Question: How do calorie burn patterns differ between age groups and genders?
Performance Question: What heart rate zones lead to optimal calorie burn rates?
Health Question: How does BMI category relate to workout intensity and calorie burn efficiency?
Data Collection Methods: - Dataset contains 15,000 workout sessions from fitness trackers - Variables include demographics, workout metrics, and physiological data - Data cleaned to remove outliers and ensure quality
Visualization Methods: - Interactive charts using plotly for exploration - Color coding based on visual perception principles - Multiple chart types optimized for different data comparisons
Key Findings:
Based on the correlation analysis:
Insight: Workout duration and body weight are the primary predictors of calorie burn, while age has surprisingly little effect on performance.
Optimization Insights:
From the duration vs. intensity analysis:
Recommendation: Focus on consistency and gradually increasing duration before maximizing intensity.
Demographic Patterns:
The analysis reveals:
Insight: Demographics provide context but individual effort and consistency matter more than age or gender for fitness outcomes.
Heart Rate Zone Insights:
The heart rate analysis shows:
Training Recommendation: Focus primarily on sustainable heart rate zones that you can maintain for your preferred workout duration.
BMI and Performance Patterns:
The BMI analysis reveals:
Health Insight: BMI category doesn’t limit workout potential - focus should be on finding sustainable routines rather than comparing absolute numbers across weight categories.
Data Collection and Processing:
Original Dataset: - 15,000 workout sessions from fitness trackers - 9 variables including demographics and workout metrics - Data spans multiple users and workout types
Data Enhancement: - Calculated BMI and categorized into health ranges - Created intensity zones based on heart rate - Derived efficiency metrics (calories per minute) - Grouped continuous variables into meaningful categories
Visualization Methods: - Interactive charts using plotly for exploration - Color coding follows visual perception principles - Multiple chart types optimized for different comparisons - Consistent theme and professional styling
Key Insights Summary: 1. Duration and weight are the strongest predictors of calorie burn 2. Moderate intensity provides good balance of effectiveness and sustainability 3. Age is less limiting than commonly assumed for fitness performance 4. Heart rate zones can be optimized based on workout duration goals 5. BMI affects total calories but doesn’t limit workout intensity potential
Limitations: - Data represents point-in-time snapshots, not longitudinal tracking - Individual metabolic differences not captured - Workout types (running, cycling, etc.) not specified - Environmental factors (temperature, humidity) not included
Future Analysis Opportunities: - Longitudinal tracking to show improvement over time - Workout type classification and comparison - Seasonal patterns and environmental factors - Personalized recommendations based on individual baselines
Conclusion: This analysis demonstrates that effective fitness is achievable across all demographics through consistent, appropriately-intensified exercise. The key is finding sustainable routines that match individual capabilities and preferences rather than pursuing maximum intensity at all costs.
---
title: "My Fitness Journey: Understanding Calorie Burn Patterns"
author: "Nehasingh Rajput"
date: "`r Sys.Date()`"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
theme: cosmo
storyboard: true
social: menu
source: embed
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
# Load required libraries
if (!require("pacman")) install.packages("pacman")
pacman::p_load(
flexdashboard, plotly, DT, viridis, scales,
corrplot, tidyverse, ggplot2, dplyr,
lubridate, RColorBrewer, gridExtra
)
# Load and prepare data
calories <- read.csv("D:/data/calories.csv") # Change this to your file path
# Enhanced data processing
calories_enhanced <- calories %>%
mutate(
# Create meaningful categories
BMI = Weight / ((Height/100)^2),
BMI_Category = case_when(
BMI < 18.5 ~ "Underweight",
BMI < 25 ~ "Normal",
BMI < 30 ~ "Overweight",
TRUE ~ "Obese"
),
Age_Group = case_when(
Age < 25 ~ "Young (18-24)",
Age < 35 ~ "Adult (25-34)",
Age < 45 ~ "Middle-aged (35-44)",
Age < 55 ~ "Mature (45-54)",
TRUE ~ "Senior (55+)"
),
Duration_Category = case_when(
Duration < 15 ~ "Short (<15 min)",
Duration < 30 ~ "Medium (15-30 min)",
Duration < 45 ~ "Long (30-45 min)",
TRUE ~ "Extended (45+ min)"
),
Intensity = case_when(
Heart_Rate < 100 ~ "Low Intensity",
Heart_Rate < 140 ~ "Moderate Intensity",
Heart_Rate < 170 ~ "High Intensity",
TRUE ~ "Maximum Intensity"
),
Calories_per_Minute = Calories / Duration,
Heart_Rate_Zone = case_when(
Heart_Rate < 114 ~ "Fat Burn Zone",
Heart_Rate < 133 ~ "Aerobic Zone",
Heart_Rate < 152 ~ "Anaerobic Zone",
TRUE ~ "Red Line Zone"
)
) %>%
# Remove any potential outliers
filter(
Duration > 0,
Calories > 0,
Heart_Rate > 60 & Heart_Rate < 200,
Body_Temp > 36 & Body_Temp < 42
)
# Color schemes based on design principles
fitness_colors <- c(
"Male" = "#3498db",
"Female" = "#e74c3c",
"Low Intensity" = "#2ecc71",
"Moderate Intensity" = "#f39c12",
"High Intensity" = "#e74c3c",
"Maximum Intensity" = "#8e44ad"
)
# Custom theme
theme_fitness <- theme_minimal() +
theme(
plot.title = element_text(size = 14, face = "bold"),
plot.subtitle = element_text(size = 11, color = "gray60"),
legend.position = "bottom",
panel.grid.minor = element_blank(),
strip.text = element_text(face = "bold")
)
```
### Project Overview {data-commentary-width=400}
```{r overview-kpis}
# Key Performance Indicators
total_workouts <- nrow(calories_enhanced)
avg_calories <- round(mean(calories_enhanced$Calories), 1)
avg_duration <- round(mean(calories_enhanced$Duration), 1)
avg_heart_rate <- round(mean(calories_enhanced$Heart_Rate), 0)
# Create summary table
kpi_summary <- data.frame(
Metric = c("Total Workouts", "Avg Calories Burned", "Avg Duration (min)", "Avg Heart Rate (bpm)"),
Value = c(paste(total_workouts), paste(avg_calories), paste(avg_duration), paste(avg_heart_rate)),
stringsAsFactors = FALSE
)
knitr::kable(kpi_summary,
caption = "Fitness Overview - Key Metrics",
col.names = c("Metric", "Value"))
```
***
**Research Questions:**
This fitness dashboard analyzes workout data to answer five key questions:
1. **Efficiency Question**: What factors most strongly predict calorie burn during workouts?
2. **Optimization Question**: Which workout duration and intensity combinations are most effective for calorie burning?
3. **Demographic Question**: How do calorie burn patterns differ between age groups and genders?
4. **Performance Question**: What heart rate zones lead to optimal calorie burn rates?
5. **Health Question**: How does BMI category relate to workout intensity and calorie burn efficiency?
**Data Collection Methods:**
- Dataset contains 15,000 workout sessions from fitness trackers
- Variables include demographics, workout metrics, and physiological data
- Data cleaned to remove outliers and ensure quality
**Visualization Methods:**
- Interactive charts using plotly for exploration
- Color coding based on visual perception principles
- Multiple chart types optimized for different data comparisons
### Q1: Calorie Burn Predictors {data-commentary-width=350}
```{r correlation-analysis, fig.height=6, fig.width=10}
# Correlation analysis
numeric_vars <- calories_enhanced %>%
select(Age, Height, Weight, Duration, Heart_Rate, Body_Temp, Calories, BMI, Calories_per_Minute)
correlation_matrix <- cor(numeric_vars, use = "complete.obs")
# Create interactive correlation plot
# Convert correlation matrix to long format for ggplot
cor_long <- correlation_matrix %>%
as.data.frame() %>%
rownames_to_column("var1") %>%
pivot_longer(-var1, names_to = "var2", values_to = "correlation") %>%
mutate(
correlation_text = round(correlation, 3),
correlation_abs = abs(correlation)
)
cor_plot <- ggplot(cor_long, aes(x = var1, y = var2, fill = correlation)) +
geom_tile(color = "white") +
geom_text(aes(label = correlation_text), color = "white", size = 3) +
scale_fill_gradient2(low = "#3498db", mid = "white", high = "#e74c3c",
midpoint = 0, limit = c(-1,1), space = "Lab",
name = "Correlation") +
labs(title = "Correlation Matrix: Factors Affecting Calorie Burn",
subtitle = "Darker colors indicate stronger relationships",
x = "", y = "") +
theme_fitness +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
ggplotly(cor_plot, tooltip = c("x", "y", "fill"))
```
***
**Key Findings:**
Based on the correlation analysis:
- **Duration** shows the strongest relationship with calories burned
- **Weight** has a strong positive correlation with calorie burn
- **Heart Rate** shows moderate correlation with calories
- **Age** shows minimal impact on workout performance
**Insight**: Workout duration and body weight are the primary predictors of calorie burn, while age has surprisingly little effect on performance.
### Q2: Duration vs Intensity Optimization {data-commentary-width=350}
```{r efficiency-analysis, fig.height=6, fig.width=10}
# Scatter plot of duration vs calories with intensity zones
efficiency_plot <- calories_enhanced %>%
ggplot(aes(x = Duration, y = Calories, color = Intensity)) +
geom_point(alpha = 0.6, size = 1.5) +
geom_smooth(method = "lm", se = FALSE, size = 1.2) +
facet_wrap(~Intensity, scales = "free") +
scale_color_manual(values = c("Low Intensity" = "#2ecc71",
"Moderate Intensity" = "#f39c12",
"High Intensity" = "#e74c3c",
"Maximum Intensity" = "#8e44ad")) +
labs(title = "Workout Efficiency: Duration vs Calorie Burn by Intensity",
subtitle = "Each panel shows different intensity levels",
x = "Duration (minutes)",
y = "Calories Burned",
color = "Intensity Level") +
theme_fitness
ggplotly(efficiency_plot, tooltip = c("x", "y", "colour"))
```
***
**Optimization Insights:**
From the duration vs. intensity analysis:
- **Higher intensity** workouts show steeper calorie burn slopes
- **Moderate intensity** provides good balance of sustainability and effectiveness
- **Linear relationships** are clear across all intensity levels
- **Time investment** remains crucial regardless of intensity
**Recommendation**: Focus on consistency and gradually increasing duration before maximizing intensity.
### Q3: Demographics and Performance {data-commentary-width=350}
```{r demographics-analysis, fig.height=8, fig.width=12}
# Box plots by age group and gender
demo_plot <- calories_enhanced %>%
ggplot(aes(x = Age_Group, y = Calories_per_Minute, fill = Gender)) +
geom_boxplot(alpha = 0.8, outlier.alpha = 0.3) +
scale_fill_manual(values = c("male" = "#3498db", "female" = "#e74c3c")) +
labs(title = "Calorie Burn Rate by Demographics",
subtitle = "Calories burned per minute of exercise",
x = "Age Group",
y = "Calories per Minute",
fill = "Gender") +
theme_fitness +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# Add statistical summary
demo_interactive <- ggplotly(demo_plot, tooltip = c("x", "y", "fill"))
demo_interactive
```
***
**Demographic Patterns:**
The analysis reveals:
- **Gender differences** exist but with substantial overlap
- **Age groups** show varying performance patterns
- **Individual variation** is significant within each demographic
- **Senior participants** often perform better than expected
**Insight**: Demographics provide context but individual effort and consistency matter more than age or gender for fitness outcomes.
### Q4: Heart Rate Zone Analysis {data-commentary-width=350}
```{r heart-rate-analysis, fig.height=6, fig.width=10}
# Heart rate zones and calorie efficiency
hr_analysis <- calories_enhanced %>%
group_by(Heart_Rate_Zone, Duration_Category) %>%
summarise(
avg_calories_per_min = mean(Calories_per_Minute),
count = n(),
.groups = "drop"
) %>%
filter(count >= 50) # Only include combinations with sufficient data
hr_plot <- hr_analysis %>%
ggplot(aes(x = Duration_Category, y = avg_calories_per_min,
fill = Heart_Rate_Zone, size = count)) +
geom_col(position = "dodge", alpha = 0.8) +
scale_fill_viridis_d(option = "plasma", name = "Heart Rate Zone") +
labs(title = "Calorie Burn Efficiency by Heart Rate Zone and Duration",
subtitle = "Average calories burned per minute",
x = "Workout Duration Category",
y = "Calories per Minute",
size = "Number of Workouts") +
theme_fitness +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
ggplotly(hr_plot, tooltip = c("x", "y", "fill", "size"))
```
***
**Heart Rate Zone Insights:**
The heart rate analysis shows:
- **Aerobic Zone** often provides excellent calorie burn efficiency
- **Different zones** work better for different workout durations
- **Sustainability** matters for longer sessions
- **Zone selection** should match fitness goals and time availability
**Training Recommendation**: Focus primarily on sustainable heart rate zones that you can maintain for your preferred workout duration.
### Q5: BMI and Workout Patterns {data-commentary-width=350}
```{r bmi-analysis, fig.height=8, fig.width=10}
# BMI analysis with multiple metrics
bmi_summary <- calories_enhanced %>%
filter(BMI_Category %in% c("Normal", "Overweight")) %>% # Focus on main categories
group_by(BMI_Category, Intensity) %>%
summarise(
avg_calories = mean(Calories),
avg_duration = mean(Duration),
avg_efficiency = mean(Calories_per_Minute),
count = n(),
.groups = "drop"
) %>%
filter(count >= 100) # Ensure sufficient sample size
# Create comparison chart
bmi_plot <- bmi_summary %>%
ggplot(aes(x = BMI_Category, y = avg_calories, fill = Intensity)) +
geom_col(position = "dodge", alpha = 0.8) +
scale_fill_manual(values = c("Low Intensity" = "#2ecc71",
"Moderate Intensity" = "#f39c12",
"High Intensity" = "#e74c3c",
"Maximum Intensity" = "#8e44ad")) +
labs(title = "Average Calories Burned by BMI Category",
subtitle = "Breakdown by workout intensity level",
x = "BMI Category",
y = "Average Calories per Session",
fill = "Intensity Level") +
theme_fitness +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
ggplotly(bmi_plot, tooltip = c("x", "y", "fill"))
```
***
**BMI and Performance Patterns:**
The BMI analysis reveals:
- **Higher BMI individuals** tend to burn more total calories per session
- **All BMI categories** can successfully engage in various intensity levels
- **Workout intensity preferences** vary but moderate intensity is popular across groups
- **Individual variation** exists within each BMI category
**Health Insight**: BMI category doesn't limit workout potential - focus should be on finding sustainable routines rather than comparing absolute numbers across weight categories.
### Data Summary and Methodology {data-commentary-width=400}
```{r data-summary}
# Data quality summary
sample_data <- calories_enhanced %>%
select(User_ID, Gender, Age, BMI, Duration, Heart_Rate, Calories, Intensity, BMI_Category) %>%
sample_n(min(100, nrow(calories_enhanced)))
DT::datatable(
sample_data,
options = list(pageLength = 10, scrollX = TRUE),
caption = "Sample of Processed Fitness Data"
) %>%
DT::formatRound(columns = c("BMI"), digits = 1)
```
***
**Data Collection and Processing:**
**Original Dataset:**
- 15,000 workout sessions from fitness trackers
- 9 variables including demographics and workout metrics
- Data spans multiple users and workout types
**Data Enhancement:**
- Calculated BMI and categorized into health ranges
- Created intensity zones based on heart rate
- Derived efficiency metrics (calories per minute)
- Grouped continuous variables into meaningful categories
**Visualization Methods:**
- Interactive charts using plotly for exploration
- Color coding follows visual perception principles
- Multiple chart types optimized for different comparisons
- Consistent theme and professional styling
**Key Insights Summary:**
1. **Duration and weight** are the strongest predictors of calorie burn
2. **Moderate intensity** provides good balance of effectiveness and sustainability
3. **Age is less limiting** than commonly assumed for fitness performance
4. **Heart rate zones** can be optimized based on workout duration goals
5. **BMI affects total calories** but doesn't limit workout intensity potential
**Limitations:**
- Data represents point-in-time snapshots, not longitudinal tracking
- Individual metabolic differences not captured
- Workout types (running, cycling, etc.) not specified
- Environmental factors (temperature, humidity) not included
**Future Analysis Opportunities:**
- Longitudinal tracking to show improvement over time
- Workout type classification and comparison
- Seasonal patterns and environmental factors
- Personalized recommendations based on individual baselines
**Conclusion:**
This analysis demonstrates that effective fitness is achievable across all demographics through consistent, appropriately-intensified exercise. The key is finding sustainable routines that match individual capabilities and preferences rather than pursuing maximum intensity at all costs.