Learn R Programming

cycleRtools (version 1.0.4)

Wbal_plots: W' balance plots.

Description

Generate three plots that effectively summarise a whole cycling dataset.

Usage

Wbal_plots(data, x = 1, n = c(1, 2, 3), xlab = NULL, xlim = NULL,
  CP = NULL, laps = FALSE, ...)

Arguments

data
a formatted dataset produced by read*().
x
numeric; 1 will plot against time (sec); 2 will plot against time (minutes); and 3 will plot against distance.
n
plots to be created (see details).
xlab
character; x axis label for bottom plot.
xlim
given in terms of x.
CP
a value for critical power annotation.
laps
logical; should laps be seperately coloured?
...
graphical parameters to be passed to par().

Value

  • a variable number of plots.

Details

The n argument describes plot options such that:
  1. plots W' balance (kJ).
  2. plots power data (W).
  3. plots an elevation profile (m).
These options can be concatenated to produce a stack of plots as desired.

See Also

Wbal.

Examples

Run this code
data(cycling_data)
Wbal_plots(cycling_data, x = 2, n = c(1, 2, 3), CP = 300)
# Show just W' balance.
Wbal_plots(cycling_data, x = 2, n = 1)
# Elevation profile on top
Wbal_plots(cycling_data, x = 2, n = c(3, 1))
# Zoom all plots to 20-40 km.
Wbal_plots(cycling_data, x = 3, CP = 300, xlim = c(20, 40), xaxs = "i")

Run the code above in your browser using DataLab