power_prof: Cycling power profiling

Description Usage Arguments Details Value Examples

Description

Generates best powers for a range of time intervals given vectors of power (Watts) and time (seconds).

Usage

1
2
power_prof(power.W, time.s, windows = seq(2 * 60, 30 * 60, 10),
  quietly = FALSE)

Arguments

power.W, time.s

numeric vectors (of equal length) describing power readings in Watts and the times at which they were recorded (in seconds).

windows

numeric; window(s) over which to derive best powers. If data are sampled consistently at 1 Hz, these effectively correspond to time windows in units of seconds. Hence, assuming 1 Hz sampling, the default is 2-30 minutes in 10 second increments.

quietly

logical; should warning messages be suppressed?

Details

In the interest of efficiency, this function returns a power profile for which time windows are not known exactly a priori. As data can be, and often are, sampled with inconsistencies, deriving best powers for known durations is computationally expensive. However, absent any inconsistencies (e.g. breaks in the data), the returned time windows will be of duration: windows / sampling_frequency. Hence, the default range for the profile should be roughly 2 to 30 minutes (in 10 second increments) assuming 1 Hz sampling.

If there are large breaks in the data, specious values might be returned. This because head unit devices will record a power value when recording is resumed after a pause, and this power value will thus be associated with a large delta time value. In effect, the power value logged when recording is resumed will be treated as the mean power output for that entire break. With obvious implications. If such a situation is encountered, this function will throw a warning if quietly = FALSE.

Value

A tbl_df with two columns: a vector of time windows and a vector of corresponding maximal mean powers.

Examples

1
2
3
data(chaingang)
pt <- with(chaingang, power_prof(power.W, time.s))
plot(pt)

jmackie4/elpatron documentation built on May 19, 2019, 12:49 p.m.