zdist_plot: Zone-time distribution plot.

Description Usage Arguments Value Examples

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

1
2
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

 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
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"
)

cycleRtools documentation built on May 2, 2019, 10:51 a.m.