Track and analyze your daily diet and exercise to understand their impact on your weight.
Developed with the software and tools below.
This repository contains a suite of R scripts designed to analyze my daily logs of diet, exercise, and weight tracking. A sample from these logs looks like,
Datetime,Value,Activity
2/24/2024 19:37:00,Dinner; 1 cucumber,Meal
2/24/2024 18:09:00,Evening Snack; 50 gms makhana with sunflower and pumpkin seeds,Meal
2/24/2024 17:35:00,"Evening Snack; 100 gm mixed nuts (almonds, cranberries etc.)",Meal
2/24/2024 13:13:00,Lunch; 3 millet pessarattu (~ 150 gms) with peanut butter,Meal
2/24/2024 12:15:00,Afternoon Drink; 1 cup caramel macchiato,Meal
2/24/2024 11:50:00,Morning Snack; 40 gms cashews + almonds,Meal
2/24/2024 9:29:00,Breakfast; Kefir chia seed pudding 350 gms,Meal
2/24/2024 9:11:00,167.6 lbs,Weight
2/24/2024 9:01:00,40 mins; indoor cycling; (~ 275 cals),Exercise
The scripts process input data from CSV files, perform detailed analyses to correlate activities with weight changes, and generate insightful visualizations showing the impact of diet and exercise on weight over time.
- Introduction
- Table of Contents
- Installation π οΈ
- Usage π§
- Features β¨
- Configuration βοΈ
- Dependencies π¦
- Contributors π₯
- License π
Follow these steps to set up the environment:
- Clone the repository to your local machine.
- Unzip the contents of
library.zip
into the repository folder. This step ensures that all required R packages are available and version-controlled. - Ensure R is installed on your machine.
Each script is designed to be run from the command line. Hereβs how to use each one:
- Processing Data:
Rscript process.R --config_file="config/process.yaml"
- Analyzing Data:
Rscript analyze.R --config_file="config/analyze.yaml"
- Generating Plots:
Rscript plot.R --config_file="config/plot.yaml"
Or use littler instead of RScript
.
Ensure that the configuration files are set correctly as per your data paths and requirements before running the scripts.
- Command Line Interface: All scripts can be run from the command line, allowing for automation and ease of use.
- Comprehensive Logging: Each step of the process, from data processing to plotting, is logged to help track the flow and troubleshoot issues.
- Interactive Plots: The final output is an interactive plot that visually represents weight changes alongside diet and exercise activities.
- Configurable: All operations can be customized through YAML configuration files located in the
config/
folder.
Configuration files in the YAML format are used to specify input details, processing parameters, and output preferences. These files are located in the config/
directory. Users can modify these files to suit their specific needs for data paths, processing logic, and visualization details.
Dependencies are managed through the included library.zip
file, which contains all the necessary R packages. This method ensures that the environment is consistent and that the package versions are controlled. Unzip this file in the project root directory before running the scripts.
If you would like to contribute to this project, please fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.