This repository hosts the AdvVisR project, which focuses on advanced data visualization techniques using R. The project analyzes a complex, simulated dataset regarding fitness activities, nutritional habits, and physiological metrics.
The core of the project involves a dual-stack approach:
- Data Engineering (Python): A sophisticated simulation engine generates realistic synthetic data (
Final_data_model.csv), enforcing logical correlations (e.g., Age vs. Metabolism, Diet Type vs. Macro Ratios). - Visualization (R): A suite of advanced, static, and interactive charts creates a narrative around the "fuel" (nutrition), the "machine" (workout mechanics), and the "results" (body composition).
- Cezary Kuźmowicz
- Wojciech Hrycenko
File: adv_vis_r_kuzmowicz_hrycenko.r
Objective To visualize the fitness journey through three thematic lenses using advanced ggplot2 extensions:
- Part 1: The Fuel (Nutrition):
- Treemap (
treemapify): Analyzes Caloric Volume vs. Sugar Content across different diets (Keto, Paleo, Vegan). - Small Multiples Radar Chart: Compares nutritional balance (Proteins, Fats, Carbs, Sodium, Water) for each diet type.
- Treemap (
- Part 2: The Machine (Process):
- Alluvial Plot (
ggalluvial): Traces the user flow from Experience Level → Workout Choice → Caloric Burn Efficiency. - Interactive Scatter (
ggiraph): Explore the relationship between Heart Rate, Calories, and Duration with hover-over exercise details. - Circular Barplot: An "Anatomical Tachometer" visualizing targeted muscle groups.
- Alluvial Plot (
- Part 3: The Results (Physiology):
- Dumbbell Plot: Contrasts Resting Heart Rate vs. Max Heart Rate vs. Training Intensity.
- Ridgeline Plot (
ggridges): Visualizes "Mountains of Fat" – body fat distribution by gender and experience level.
File: Data/data_modelling_macros.py
Description A Python script designed to generate high-quality synthetic data for visualization purposes. It goes beyond simple random generation by applying "physics enforcement" logic:
- Population Balancing: Ensures balanced representation of difficulty levels.
- Macro Restructuring: Adjusts nutrient profiles (Proteins/Fats/Carbs) dynamically based on Diet Type (e.g., Keto has high fats/low carbs).
- Correlation Engineering: Enforces realistic biological relationships (e.g., BMI > 25 increases Heart Rate effort; Age reduces Max Heart Rate).
Project Each student is obliged to submit group project (at most 2 students per group) regarding data visualisation. Topic and database can be selected freely as long as it utilizes techniques used for visualization in R (not necessarily discussed during classes). The basic requirements and conditions:
- Submitting project topic, dataset and group: End of the November,
- Performing presentation: last two classes in January,
- Submitting scripts and short description of the analysis.
The points (70%) can be gain from:
- Attractiveness of the chosen topic, quality of the insights infered from data,
- Advancement and innovativeness of R codes, effort invested in the project,
- Accuracy and visual aspect of the presentation,
- Attractiveness of the presentation.
Charts Documentation: Google Docs Link
The project utilizes a mix of R for visualization and Python for data preparation:
- tidyverse (ggplot2, dplyr): Core data manipulation and plotting.
- ggalluvial: For flow diagrams (Alluvial plots).
- treemapify: For creating treemaps.
- ggiraph: For adding interactivity to ggplot2 geometries.
- ggridges: For ridgeline density plots.
- ggcorrplot: For visualization of correlation matrices.
- Pandas & NumPy: For data frame manipulation and numerical simulation.
- Clone this repository.
- Data Generation (Optional): Run
Data/data_modelling_macros.pyif you wish to regenerate the dataset with new random seeds. - Visualization: Open
adv_vis_r_kuzmowicz_hrycenko.rin RStudio. - Ensure the working directory is set correctly (
setwd(...)). - Run the script to generate the plots in the RStudio Viewer.