perform_average | R Documentation |
This function performs either a bin- or a rolling-average on the interpolated data.
You must specify the type
of the average before continuing.
perform_average(
.data,
type = c("bin", "rolling", "ensemble"),
bins = 30,
rolling_window = 30
)
.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. |
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.
a tibble
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.