athlytics

๐Ÿƒ An R package for advanced sports performance analysis and training load monitoring using Strava data.

https://github.com/hzacode/athlytics

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • โ—‹
    CITATION.cff file
  • โœ“
    codemeta.json file
    Found codemeta.json file
  • โœ“
    .zenodo.json file
    Found .zenodo.json file
  • โœ“
    DOI references
    Found 1 DOI reference(s) in README
  • โœ“
    Academic publication links
    Links to: biorxiv.org
  • โ—‹
    Academic email domains
  • โ—‹
    Institutional organization owner
  • โ—‹
    JOSS paper metadata
  • โ—‹
    Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

๐Ÿƒ An R package for advanced sports performance analysis and training load monitoring using Strava data.

Basic Info
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed 10 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

# Athlytics *An R Framework for Longitudinal Analysis of Exercise Physiology*

CRAN Version

Project Status R-CMD-check Codecov License: MIT

Website PRs Welcome bioRxiv Preprint


Athlytics is an R framework for the longitudinal analysis of exercise physiology using Strava data. It is designed to remove the primary bottleneck for sports scientists: the programmatic acquisition and consistent processing required to turn raw, high-frequency ecological data into quantitative insights.


โœจ Core Features

| Feature | Description | | ----------------------------- | ------------------------------------------------------------------------------------------------------- | | ๐Ÿ“ˆ Longitudinal Quantification | Automated calculation of configurable metrics (ACWR, EF). Enables longitudinal tracking of physiological adaptation. | | ๐Ÿ’” High-Resolution Decoupling | Robust cardiovascular drift analysis from raw stream data. Methodologically superior to metrics from simple averages. | | ๐Ÿงน Tidy & Modeling-Ready Outputs | Clean tibbles from every function. Eliminates data cleaning. Primed for ggplot2 visualization and statistical modeling. | | ๐Ÿ”Œ Reproducible Data Acquisition | Programmatic Strava API workflow. Guarantees full methodological reproducibility and eliminates manual download errors. |


To see how these features come together in a full research case study, check out our Complete Analysis Example.

๐Ÿš€ Quick Start

1. Installation

```r

CRAN (stable)

install.packages("Athlytics")

GitHub (recommended for the latest features)

install.packages("remotes")

remotes::install_github("HzaCode/Athlytics") ```

2. Authentication with Strava (click to expand)
`athlytics` leverages the `rStrava` package for handling the OAuth 2.0 authentication process with the Strava API. This requires a one-time setup of a Strava API application to obtain a **Client ID** and **Client Secret**. **Steps** 1. **Create a Strava API Application:** Go to your Strava settings โ†’ **My API Application** ([https://www.strava.com/settings/api](https://www.strava.com/settings/api)). Set the **Authorization Callback Domain** to `localhost`. 2. **Authenticate in R:** Use `rStrava::strava_oauth()` to generate the token. Using `cache = TRUE` is highly recommended for reproducible workflows. ```r library(athlytics) library(rStrava) # Recommended: keep secrets out of scripts # Sys.setenv(STRAVA_CLIENT_ID = "YOUR_CLIENT_ID") # Sys.setenv(STRAVA_CLIENT_SECRET = "YOUR_CLIENT_SECRET") stoken <- rStrava::strava_oauth( app_name = "MyResearchApp", app_client_id = Sys.getenv("STRAVA_CLIENT_ID"), app_secret = Sys.getenv("STRAVA_CLIENT_SECRET"), app_scope = "activity:read_all", cache = TRUE ) ```

๐Ÿ“Š Compute โ†’ Plot

Note on Workflow: Computation is decoupled from plotting. This design reduces API calls and accelerates analysis by allowing a single, computed data object to be used for multiple visualizations.

1) ACWR โ€” Load Ramp Monitoring

r acwr_data <- calculate_acwr(stoken = stoken, load_metric = "duration_mins") plot_acwr(acwr_df = acwr_data, highlight_zones = TRUE)

2) Exposure โ€” ATL vs. CTL

r expo_data <- calculate_exposure(stoken = stoken, activity_type = "Ride", load_metric = "tss", user_ftp = 280) plot_exposure(exposure_df = expo_data, risk_zones = TRUE)

3) Efficiency Factor โ€” Aerobic Adaptation

r ef_data <- calculate_ef(stoken = stoken, activity_type = c("Run", "Ride"), ef_metric = "Pace_HR") plot_ef(ef_df = ef_data, activity_type = c("Run", "Ride"), add_trend_line = TRUE)

4) Personal Bests โ€” Peak Performance

r pbs_data <- calculate_pbs(stoken = stoken, activity_type = "Run", distance_meters = c(1000, 5000, 10000)) plot_pbs(pbs_df = pbs_data, activity_type = "Run", distance_meters = c(1000, 5000, 10000))

5) Aerobic Decoupling โ€” Cardiovascular Drift

r decoupling_data <- calculate_decoupling(stoken = stoken, activity_type = "Run", max_activities = 20) plot_decoupling(decoupling_df = decoupling_data, activity_type = "Run")


๐Ÿค Contributing

Pull requests are welcome! Please see CONTRIBUTING.md for details and follow the code of conduct in CODE_OF_CONDUCT.md.

Owner

  • Name: Ang
  • Login: HzaCode
  • Kind: user

GitHub Events

Total
  • Watch event: 2
  • Delete event: 2
  • Push event: 140
  • Pull request event: 7
  • Create event: 9
Last Year
  • Watch event: 2
  • Delete event: 2
  • Push event: 140
  • Pull request event: 7
  • Create event: 9

Issues and Pull Requests

Last synced: 10 months ago

Packages

  • Total packages: 1
  • Total downloads:
    • cran 524 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: Athlytics

Advanced Sports Performance Analysis for 'Strava' Data

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 524 Last month
Rankings
Dependent packages count: 26.5%
Dependent repos count: 32.7%
Average: 48.6%
Downloads: 86.7%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
.github/workflows/R-CMD-check.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite