| Type: | Package | 
| Title: | Acute Chronic Workload Ratio Calculation | 
| Version: | 0.1.0 | 
| Maintainer: | Jorge R Fernandez-Santos <jorgedelrosario.fernandez@uca.es> | 
| 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>. | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| Imports: | r2d3 | 
| Depends: | R (≥ 2.10) | 
| RoxygenNote: | 7.1.1 | 
| URL: | https://github.com/JorgeDelro/ACWR | 
| BugReports: | https://github.com/JorgeDelro/ACWR/issues | 
| Suggests: | testthat (≥ 3.0.0) | 
| Config/testthat/edition: | 3 | 
| NeedsCompilation: | no | 
| Packaged: | 2022-02-25 08:17:28 UTC; jorge | 
| Author: | Jorge R Fernandez-Santos
     | 
| Repository: | CRAN | 
| Date/Publication: | 2022-03-01 08:10:06 UTC | 
Acute Chronic Workload Ratio
Description
Acute Chronic Workload Ratio
Usage
ACWR(
  db,
  ID,
  TL,
  weeks,
  days,
  training_dates,
  ACWR_method = c("EWMA", "RAC", "RAU")
)
Arguments
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  | 
Value
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
Examples
## 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
Description
Exponentially Weighted Moving Average
Usage
EWMA(TL)
Arguments
TL | 
 training load  | 
Value
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.
Examples
## 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)
Rolling Average Coupled
Description
Rolling Average Coupled
Usage
RAC(TL, weeks, training_dates)
Arguments
TL | 
 training load  | 
weeks | 
 training weeks  | 
training_dates | 
 training dates  | 
Value
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.
Examples
## 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
Description
Rolling Average Uncoupled
Usage
RAU(TL, weeks, training_dates)
Arguments
TL | 
 training load  | 
weeks | 
 training weeks  | 
training_dates | 
 training dates  | 
Value
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.
Examples
## 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)
ACWR plots using d3.js
Description
ACWR plots using d3.js
Usage
plot_ACWR(
  db,
  TL,
  ACWR,
  day,
  ID = NULL,
  colour = NULL,
  xLabel = NULL,
  y0Label = NULL,
  y1Label = NULL,
  plotTitle = NULL
)
Arguments
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"  | 
Value
This function returns a d3.js object for a single subject. For several subjects it returns a list of d3.js objects.
Examples
## 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)
Create Training Blocks
Description
Create Training Blocks
Usage
training_blocks(training_dates, actual_TL, diff_dates)
Arguments
training_dates | 
 training dates  | 
actual_TL | 
 position of the actual training load  | 
diff_dates | 
 difference in days  | 
Training load dataframe
Description
A dataframe with the training load of 3 subjects.
Usage
data("training_load", package = "ACWR")
Format
An object of class tbl_df (inherits from tbl, data.frame) with 84 rows and 5 columns.
Variables
- ID
 ID of the subjects
- Week
 training weeks
- Day
 training days
- TL
 training load (arbitrary units)
- Training_Date
 training dates