# 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)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab