zdist_plot {cycleRtools}R Documentation

Zone-time distribution plot.

Description

Display the time distribution of values within a dataset. The distribution can also be partitioned into zones if the zbounds argument is not NULL.

Usage

zdist_plot(data, column = "power.W", binwidth = 10, zbounds = NULL,
  character.only = FALSE, ...)

Arguments

data

a "cycleRdata" object, produced from a read_ride function.

column

column in data giving the values of interest. Needn't be quoted.

binwidth

how should values in column be binned? E.g. bindiwdth = 10 will create 10 watt bins if column is power data.

zbounds

optional; a numeric vector of zone boundaries.

character.only

are column name arguments given as character strings? A backdoor around non-standard evaluation.

...

arguments to be passed to barplot() and/or graphical parameters (par).

Value

nothing; a plot is sent to the current graphics device.

Examples

data(ridedata)

## Using power.
zdist_plot(
 data = ridedata, column = power.W,
 binwidth = 10,  # 10 watt bins.
 zbounds = c(100, 200, 300),
 xlim = c(110, 500), xlab = "Power (Watts)",
 main = "Power distribution" # Argument passed to barplot.
)

## Using speed.
zdist_plot(
  data = ridedata, column = speed.kmh,
  binwidth = 2,  # 2 km/hr bins.
  zbounds = c(10, 20, 30),
  xlab = "Speed (km/hr)",
  main = "Speed distribution"
)

## Without zone colouring (produces a warning).
zdist_plot(
  data = ridedata, column = speed.kmh,
  binwidth = 5,  # 2 km/hr bins.
  xlab = "Speed (km/hr)", main = "Dull"
)


[Package cycleRtools version 1.1.1 Index]