Title: | Acute Chronic Workload Ratio Calculation |
---|---|
Description: | Functions for calculating the acute chronic workload ratio using three different methods: exponentially weighted moving average (EWMA), rolling average coupled (RAC) and rolling averaged uncoupled (RAU). Examples of this methods can be found in Williams et al. (2017) <doi:10.1136/bjsports-2016-096589> for EWMA and Windt & Gabbet (2018) for RAC and RAU <doi: 10.1136/bjsports-2017-098925>. |
Authors: | Jorge R Fernandez-Santos [aut, cre]
|
Maintainer: | Jorge R Fernandez-Santos <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2025-03-01 02:49:19 UTC |
Source: | https://github.com/jorgedelro/acwr |
Acute Chronic Workload Ratio
ACWR( db, ID, TL, weeks, days, training_dates, ACWR_method = c("EWMA", "RAC", "RAU") )
ACWR( db, ID, TL, weeks, days, training_dates, ACWR_method = c("EWMA", "RAC", "RAU") )
db |
a data frame |
ID |
ID of the subjects |
TL |
training load |
weeks |
training weeks |
days |
training days |
training_dates |
training dates |
ACWR_method |
method to calculate ACWR |
a data frame with the acute & chronic training load and ACWR calculated with the selected method/s and added on the left side of the data frame
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read dfs data("training_load", package = "ACWR") # Convert to data.frame training_load <- data.frame(training_load) # Calculate ACWR result_ACWR <- ACWR(db = training_load, ID = "ID", TL = "TL", weeks = "Week", days = "Day", training_dates = "Training_Date", ACWR_method = c("EWMA", "RAC", "RAU")) # set user working directory setwd(oldwd) ## End(Not run)
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read dfs data("training_load", package = "ACWR") # Convert to data.frame training_load <- data.frame(training_load) # Calculate ACWR result_ACWR <- ACWR(db = training_load, ID = "ID", TL = "TL", weeks = "Week", days = "Day", training_dates = "Training_Date", ACWR_method = c("EWMA", "RAC", "RAU")) # set user working directory setwd(oldwd) ## End(Not run)
Exponentially Weighted Moving Average
EWMA(TL)
EWMA(TL)
TL |
training load |
This function returns the following variables:
EWMA_chronic: EWMA - chronic training load.
EWMA_acute: EWMA - acute training load.
EWMA_ACWR: EWMA - Acute-Chronic Workload Ratio.
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read db data("training_load", package = "ACWR") # Convert to data.frame training_load <- data.frame(training_load) # Select the first subject training_load_1 <- training_load[training_load[["ID"]] == 1, ] # Calculate ACWR result_EWMA <- EWMA(TL = training_load_1$TL) # set user working directory setwd(oldwd) ## End(Not run)
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read db data("training_load", package = "ACWR") # Convert to data.frame training_load <- data.frame(training_load) # Select the first subject training_load_1 <- training_load[training_load[["ID"]] == 1, ] # Calculate ACWR result_EWMA <- EWMA(TL = training_load_1$TL) # set user working directory setwd(oldwd) ## End(Not run)
ACWR plots using d3.js
plot_ACWR( db, TL, ACWR, day, ID = NULL, colour = NULL, xLabel = NULL, y0Label = NULL, y1Label = NULL, plotTitle = NULL )
plot_ACWR( db, TL, ACWR, day, ID = NULL, colour = NULL, xLabel = NULL, y0Label = NULL, y1Label = NULL, plotTitle = NULL )
db |
a data frame |
TL |
training load |
ACWR |
Acute Chronic Workload Ratio |
day |
training days |
ID |
ID of the subjects |
colour |
colour of the bars. By default "#87CEEB" (skyblue) |
xLabel |
x-axis label. By default "Days" |
y0Label |
left y-axis label. By default "Load [AU]" |
y1Label |
right y-axis label. By default "Acute:chronic worload ratio" |
plotTitle |
Title of the plot. By default "ACWR" |
This function returns a d3.js object for a single subject. For several subjects it returns a list of d3.js objects.
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read db data("training_load", package = "ACWR") # Convert to data.frame training_load_db <- data.frame(training_load) # Calculate ACWR result_ACWR <- ACWR(db = training_load_db, ID = "ID", TL = "TL", weeks = "Week", days = "Day", training_dates = "Training_Date", ACWR_method = c("EWMA", "RAC", "RAU")) # Plot for 1 subject # Select the first subject result_ACWR_1 <- result_ACWR[result_ACWR[["ID"]] == 1, ] # plot ACWR (e.g. EWMA) ACWR_plot_1 <- plot_ACWR(db = result_ACWR_1, TL = "TL", ACWR = "EWMA_ACWR", day = "Day") # Plot for several subjects # plot ACWR (e.g. RAC) ACWR_plot <- plot_ACWR(db = result_ACWR, TL = "TL", ACWR = "RAC_ACWR", day = "Day", ID = "ID") # set user working directory setwd(oldwd) ## End(Not run)
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read db data("training_load", package = "ACWR") # Convert to data.frame training_load_db <- data.frame(training_load) # Calculate ACWR result_ACWR <- ACWR(db = training_load_db, ID = "ID", TL = "TL", weeks = "Week", days = "Day", training_dates = "Training_Date", ACWR_method = c("EWMA", "RAC", "RAU")) # Plot for 1 subject # Select the first subject result_ACWR_1 <- result_ACWR[result_ACWR[["ID"]] == 1, ] # plot ACWR (e.g. EWMA) ACWR_plot_1 <- plot_ACWR(db = result_ACWR_1, TL = "TL", ACWR = "EWMA_ACWR", day = "Day") # Plot for several subjects # plot ACWR (e.g. RAC) ACWR_plot <- plot_ACWR(db = result_ACWR, TL = "TL", ACWR = "RAC_ACWR", day = "Day", ID = "ID") # set user working directory setwd(oldwd) ## End(Not run)
Rolling Average Coupled
RAC(TL, weeks, training_dates)
RAC(TL, weeks, training_dates)
TL |
training load |
weeks |
training weeks |
training_dates |
training dates |
This function returns the following variables:
RAC_chronic: RAC - chronic training load.
RAC_acute: RAC - acute training load.
RAC_ACWR: RAC - Acute-Chronic Workload Ratio.
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read db data("training_load", package = "ACWR") # Convert to data.frame training_load <- data.frame(training_load) # Select the first subject training_load_1 <- training_load[training_load[["ID"]] == 1, ] # Calculate ACWR result_RAC <- RAC(TL = training_load_1$TL, weeks = training_load_1$Week, training_dates = training_load_1$Training_Date) # set user working directory setwd(oldwd) ## End(Not run)
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read db data("training_load", package = "ACWR") # Convert to data.frame training_load <- data.frame(training_load) # Select the first subject training_load_1 <- training_load[training_load[["ID"]] == 1, ] # Calculate ACWR result_RAC <- RAC(TL = training_load_1$TL, weeks = training_load_1$Week, training_dates = training_load_1$Training_Date) # set user working directory setwd(oldwd) ## End(Not run)
Rolling Average Uncoupled
RAU(TL, weeks, training_dates)
RAU(TL, weeks, training_dates)
TL |
training load |
weeks |
training weeks |
training_dates |
training dates |
This function returns the following variables:
RAU_chronic: RAU - chronic training load.
RAU_acute: RAU - acute training load.
RAU_ACWR: RAU - Acute-Chronic Workload Ratio.
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read db data("training_load", package = "ACWR") # Convert to data.frame training_load <- data.frame(training_load) # Select the first subject training_load_1 <- training_load[training_load[["ID"]] == 1, ] # Calculate ACWR result_RAU <- RAU(TL = training_load_1$TL, weeks = training_load_1$Week, training_dates = training_load_1$Training_Date) # set user working directory setwd(oldwd) ## End(Not run)
## Not run: # Get old working directory oldwd <- getwd() # Set temporary directory setwd(tempdir()) # Read db data("training_load", package = "ACWR") # Convert to data.frame training_load <- data.frame(training_load) # Select the first subject training_load_1 <- training_load[training_load[["ID"]] == 1, ] # Calculate ACWR result_RAU <- RAU(TL = training_load_1$TL, weeks = training_load_1$Week, training_dates = training_load_1$Training_Date) # set user working directory setwd(oldwd) ## End(Not run)
Create Training Blocks
training_blocks(training_dates, actual_TL, diff_dates)
training_blocks(training_dates, actual_TL, diff_dates)
training_dates |
training dates |
actual_TL |
position of the actual training load |
diff_dates |
difference in days |
A dataframe with the training load of 3 subjects.
data("training_load", package = "ACWR")
data("training_load", package = "ACWR")
An object of class tbl_df
(inherits from tbl
, data.frame
) with 84 rows and 5 columns.
ID of the subjects
training weeks
training days
training load (arbitrary units)
training dates