plot_ACWR {ACWR} | R Documentation |
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)
[Package ACWR version 0.1.0 Index]