mmv: Maximal mean values.

Description Usage Arguments Value See Also Examples

Description

Calculate maximal mean values for specified time periods.

Usage

1
mmv(data, column, windows, deltat = NULL, character.only = FALSE)

Arguments

data

a formatted dataset produced by read*().

column

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

windows

window size(s) for which to generate best averages, given in seconds.

deltat

the sampling frequency of data in seconds per sample; typically 0.5 or 1. If NULL, this is estimated.

character.only

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

Value

a matrix object with two rows: 1) best mean values and 2) the time at which those values were recorded

See Also

For a more generic and efficient version of this function, see mmv2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(ridedata)

## Best power for 5 and 20 minutes.
tsec <- c(5, 20) * 60
mmv(ridedata, power.W, tsec)

## Generate a simple critical power estimate.
tsec <- 2:20 * 60
pwrs <- mmv(ridedata, power.W, tsec)
m <- lm(pwrs[1, ] ~ {1 / tsec})  # Simple inverse model.
coef(m)[1]  # Intercept = critical power.

## More complex models...
m <- Pt_model(pwrs[1, ], tsec)
print(m)
## Extract the asymptote of the exponential model.
coef(m)$exp["CP"]


Search within the cycleRtools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.