perform_average {whippr} | R Documentation |
Perform average on second-by-second data
Description
This function performs either a bin- or a rolling-average on the interpolated data.
You must specify the type
of the average before continuing.
Usage
perform_average(
.data,
type = c("bin", "rolling", "ensemble"),
bins = 30,
rolling_window = 30
)
Arguments
.data |
The second-by-second data retrieved from |
type |
The type of the average to perform. Either |
bins |
If bin-average is chosen, here you can specify the size of the bin-average, in seconds. Default to 30-s bin-average. |
rolling_window |
If rolling-average is chosen, here you can specify the rolling-average window, in seconds. Default to 30-s rolling-average. |
Details
Ensemble average is used in VO2 kinetics analysis, where a series of transitions from baseline to the moderate/heavy/severe intensity-domain is ensembled averaged into a single 'bout' for further data processing.
Value
a tibble
Examples
## Not run:
## get file path from example data
path_example <- system.file("example_cosmed.xlsx", package = "whippr")
## read data
df <- read_data(path = path_example, metabolic_cart = "cosmed")
## interpolate and perform 30-s bin-average
df %>%
interpolate() %>%
perform_average(type = "bin", bins = 30)
## interpolate and perform 30-s rolling-average
df %>%
interpolate() %>%
perform_average(type = "rolling", rolling_window = 30)
## End(Not run)
[Package whippr version 0.1.3 Index]