Calculate time in zones.

Share:

Description

Given a vector of zone boundaries, sums the time spent in each zone.

Usage

1
2
zone_time(data, column = "power.W", zbounds, pct = FALSE,
  character.only = FALSE)

Arguments

data

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

column

the column name of the data to which the zone boundaries relate.

zbounds

numeric; zone boundaries.

pct

should percentage values be returned?

character.only

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

Value

a data frame of zone times.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(ridedata)

## Time spent above and below critical power...
zone_time(ridedata, "power.W", zbounds = 300) / 60  # Minutes.

## Or with more zones...
zone_time(ridedata, "power.W", zbounds = c(100, 200, 300)) / 60

## Or given as a percentage...
zone_time(ridedata, "power.W", zbounds = c(100, 200, 300), pct = TRUE)