knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

cyclingtools

Lifecycle: maturing CRAN status R build status

The goal of cyclingtools is to provide tools for making easier to analyze data in cycling.

Installation

You can install the development version of cyclingtools from GitHub with:

# install.packages("remotes")
remotes::install_github("fmmattioni/cyclingtools")

Usage

Critical Power

Demo data

The package comes with a demonstration data frame to show how the functions work and also to show you how you can setup your data:

library(cyclingtools)

demo_critical_power

Simple analysis

Perform a simple analysis from the chosen critical power models:

simple_results <- critical_power(
  .data = demo_critical_power, 
  power_output_column = "PO", 
  time_to_exhaustion_column = "TTE", 
  method = c("3-hyp", "2-hyp", "linear", "1/time"), 
  plot = TRUE, 
  all_combinations = FALSE,
  reverse_y_axis = FALSE
)

simple_results

You can also plot the results:

simple_results %>% 
  dplyr::filter(method == "3-hyp") %>% 
  dplyr::pull(plot)

All possible combinations analysis

You can also perform an analysis with all the possible combinations of time-to-exhaustion trials provided. All you need to do is to set all_combinations = TRUE:

combinations_results <- critical_power(
  .data = demo_critical_power, 
  power_output_column = "PO", 
  time_to_exhaustion_column = "TTE", 
  method = c("3-hyp", "2-hyp", "linear", "1/time"), 
  plot = TRUE, 
  all_combinations = TRUE,
  reverse_y_axis = FALSE
)

combinations_results

You can also plot the results:

combinations_results %>% 
  dplyr::slice(1) %>% 
  dplyr::pull(plot)

Critical Speed

Demo data

demo_critical_speed

Simple analysis

Perform a simple analysis from the chosen critical power models:

simple_results <- critical_speed(
  .data = demo_critical_speed, 
  distance_column = "Distance", 
  time_to_exhaustion_column = "TTE", 
  method = c("3-hyp", "2-hyp", "linear", "1/time"), 
  plot = TRUE, 
  all_combinations = FALSE,
  reverse_y_axis = FALSE
)

simple_results

You can also do all of these analyses in our shiny app:

Critical Power Dashboard

Coming soon

Related work

cycleRtools: A suite of functions for analysing cycling data.

Citation

citation("cyclingtools")


fmmattioni/cyclingtools documentation built on March 28, 2022, 5:33 p.m.