Description Usage Arguments Value Author(s) Examples
It generates the plot for the 3 metrics calculated using the function metrics_moving_avg.
1 | plot_metrics(dates_list, pmax_all = NULL, wbal_all = NULL, mftp_all = NULL, period = 90)
|
dates_list |
A vector containing all dates and times from every training session. It's good to use with get_power_data() within Golden Cheetah. |
pmax_all |
The maximum power estimation for each 90-day period, in watts. It's the output of metrics_moving_avg. |
wbal_all |
The anaerobic capacity estimations for each 90-day period, in Joules. It's the output of metrics_moving_avg. |
mftp_all |
The modeled functional threshold power estimation for each 90-day period, in watts. It's the output of metrics_moving_avg. |
period |
The period of days to calculate the moving average. The default is 90 days as in function metrics_moving_avg. |
It prints 3 plots about the metrics PMax, WBal and mFTP, for each date between the first and last dates in dates_list.
Natan Freitas Leite.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | ## The function is currently defined as
function (dates_list, pmax_all = NULL, wbal_all = NULL, mftp_all = NULL,
period = 90)
{
if (length(pmax_all) != 0) {
plot(seq(dates_list[1] + period, tail(dates_list, 1),
length.out = length(pmax_all)), pmax_all, type = "l",
lwd = 2, col = "purple", xaxt = "n", main = paste("PMax: Rolling",
period, "days"), xlab = "Date", ylab = "Watts")
axis(side = 1, at = seq(dates_list[1] + period, tail(dates_list,
1), length.out = 8), labels = format(seq(dates_list[1] +
period, tail(dates_list, 1), length.out = 8), "%b-%y"))
abline(v = seq(dates_list[1] + period, tail(dates_list,
1), length.out = 8), col = "grey", lwd = 0.5, lty = "dotted")
grid(NA, NULL)
}
if (length(wbal_all) != 0) {
plot(seq(dates_list[1] + period, tail(dates_list, 1),
length.out = length(wbal_all)), wbal_all, type = "l",
lwd = 2, col = "orange", xaxt = "n", main = paste("W': Rolling",
period, "days"), xlab = "Date", ylab = "Joules")
axis(side = 1, at = seq(dates_list[1] + period, tail(dates_list,
1), length.out = 8), labels = format(seq(dates_list[1] +
period, tail(dates_list, 1), length.out = 8), "%b-%y"))
abline(v = seq(dates_list[1] + period, tail(dates_list,
1), length.out = 8), col = "grey", lwd = 0.5, lty = "dotted")
grid(NA, NULL)
}
if (length(mftp_all) != 0) {
plot(seq(dates_list[1] + period, tail(dates_list, 1),
length.out = length(mftp_all)), mftp_all, type = "l",
lwd = 2, col = "red", xaxt = "n", main = paste("Modeled FTP: Rolling",
period, "days"), xlab = "Date", ylab = "Watts")
axis(side = 1, at = seq(dates_list[1] + period, tail(dates_list,
1), length.out = 8), labels = format(seq(dates_list[1] +
period, tail(dates_list, 1), length.out = 8), "%b-%y"))
abline(v = seq(dates_list[1] + period, tail(dates_list,
1), length.out = 8), col = "grey", lwd = 0.5, lty = "dotted")
grid(NA, NULL)
}
}
data(metrics)
par(mfrow=c(1,3))
plot_metrics(dates_list_updt,metrics[[1]],metrics[[2]],metrics[[3]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.