Skip to content

Commit 26572de

Browse files
committed
Export parse_activity_file and calculate_ef_from_stream functions, fix README YAML parsing, update documentation
1 parent 805c924 commit 26572de

27 files changed

+2131
-266
lines changed

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ export(calculate_acwr)
1313
export(calculate_acwr_ewma)
1414
export(calculate_decoupling)
1515
export(calculate_ef)
16+
export(calculate_ef_from_stream)
1617
export(calculate_exposure)
1718
export(calculate_pbs)
1819
export(cohort_reference)
1920
export(flag_quality)
2021
export(load_local_activities)
22+
export(parse_activity_file)
2123
export(plot_acwr)
2224
export(plot_acwr_comparison)
2325
export(plot_acwr_enhanced)

R/calculate_ef.R

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,23 @@ calculate_ef <- function(activities_data,
327327
return(ef_data)
328328
}
329329

330-
#' Internal: Calculate EF from Stream Data with Steady-State Analysis
331-
#' @keywords internal
332-
#' @noRd
330+
#' Calculate EF from Stream Data with Steady-State Analysis
331+
#'
332+
#' Calculate efficiency factor (EF) from detailed stream data using steady-state analysis.
333+
#' This function analyzes heart rate and power/pace data to find periods of steady effort
334+
#' and calculates the efficiency factor for those periods.
335+
#'
336+
#' @param stream_data Data frame with stream data (time, heartrate, watts/distance columns)
337+
#' @param activity_date Date of the activity
338+
#' @param act_type Activity type (e.g., "Run", "Ride")
339+
#' @param ef_metric Efficiency metric to calculate ("pace_hr" or "power_hr")
340+
#' @param min_steady_minutes Minimum duration for steady-state analysis (minutes)
341+
#' @param steady_cv_threshold Coefficient of variation threshold for steady state
342+
#' @param min_hr_coverage Minimum heart rate data coverage required
343+
#' @param quality_control Quality control setting ("off", "flag", "filter")
344+
#'
345+
#' @return Data frame with EF calculation results
346+
#' @export
333347
calculate_ef_from_stream <- function(stream_data, activity_date, act_type, ef_metric,
334348
min_steady_minutes, steady_cv_threshold, min_hr_coverage, quality_control) {
335349

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Designed for athletes, coaches, and sports scientists, Athlytics standardizes th
7272

7373
***Reproducible and Shareable**: Because the workflow is self-contained, your analysis scripts are easy to share and will produce the same results every time, making it ideal for reliable, long-term tracking.
7474

75-
---
75+
***
7676

7777
## 📦 Installation
7878

@@ -91,7 +91,8 @@ install.packages("Athlytics")
9191
remotes::install_github("HzaCode/Athlytics")
9292
```
9393

94-
---
94+
***
95+
9596
### 🚀 Quick Start
9697

9798

@@ -129,7 +130,7 @@ individual_acwr <- cohort_acwr %>% filter(athlete_id == "A1")
129130
plot_with_reference(individual = individual_acwr, reference = reference_bands)
130131
```
131132

132-
---
133+
***
133134

134135
## 📊 Core Analyses
135136

@@ -162,7 +163,7 @@ Measure your endurance by analyzing how much your heart rate "drifts" upward dur
162163
<em><a href="https://hezhiang.com/Athlytics/reference/calculate_decoupling.html">Learn more about Decoupling...</a></em>
163164
</p>
164165

165-
---
166+
***
166167

167168
## 📝 Citation
168169

@@ -178,7 +179,7 @@ If you use **Athlytics** in your research, please cite the software. We also rec
178179
}
179180
```
180181

181-
---
182+
***
182183

183184
## 🤝 Contributing
184185

docs/CONTRIBUTING.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/advanced_features.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/athlytics_introduction.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)