summarise_loading {impactr} | R Documentation |
Summarise mechanical loading variables
Description
Creates a summary table of the selected mechanical loading variables including the number of peaks, the minimum, maximum, mean and standard deviation values of these peaks and also the number of peaks inside a given magnitude range. The summaries can be displayed by day or as a daily average.
Usage
summarise_loading(
data,
variable,
vector,
daily_average = TRUE,
ranges_acc = NULL,
ranges_grf = NULL,
ranges_lr = NULL,
save_summary = FALSE
)
Arguments
data |
An |
variable |
A character vector indicating the variable to summarise. Can be either "acc" (for the acceleration peaks), "grf" (for the ground reaction force peaks), "lr" (for the loading rate peaks) or "all" (for all variables). |
vector |
A character string indicating which vector to use to create the summaries. Can be "resultant", "vertical" or "all". |
daily_average |
Create a daily average summary? Can be |
ranges_acc , ranges_grf , ranges_lr |
A numeric vector to specify ranges in
which to count the peaks. E.g., If |
save_summary |
Indicates whether or not to save the summary to a csv
file(s). Defaults to |
Value
A tibble (or a list of tibbles) with the requested summaries.
Examples
# Ensure that {accdata} package is available before running the example.
# If it is not, run install_accdata() to install the required package.
if (requireNamespace("accdata", quietly = TRUE)) {
data <- import_dataset("daily_acc_3d")
data <- remove_nonwear(data)
data <- filter_acc(data)
data <- find_peaks(data, vector = "vertical")
summarise_loading(
data,
variable = "acc", vector = "vertical",
ranges_acc = 1:5
)
}