average_results {activAnalyzer}R Documentation

Average results over valid days

Description

This function computes, using valid days only, the mean of each of the metrics obtained using the recap_by_day function. The median can also be obtained with an appropriate configuration of the function.

Usage

average_results(data, minimum_wear_time = 10, fun = c("mean", "median"))

Arguments

data

A dataframe obtained using the prepare_dataset, mark_wear_time, mark_intensity, and then the recap_by_day functions.

minimum_wear_time

A numeric value (in hours) to set the minimum wear time duration for validating a day.

fun

A character value indicating whether means or medians should be computed.

Value

A dataframe.

Examples


file <- system.file("extdata", "acc.agd", package = "activAnalyzer")
mydata <- prepare_dataset(data = file)
mydata_with_wear_marks <- mark_wear_time(
    dataset = mydata, 
    TS = "TimeStamp", 
    to_epoch = 60,
    cts  = "vm",
    frame = 90, 
    allowanceFrame = 2, 
    streamFrame = 30
    )
mydata_with_intensity_marks <- mark_intensity(
    data = mydata_with_wear_marks, 
    col_axis = "vm", 
    equation = "Sasaki et al. (2011) [Adults]",
    sed_cutpoint = 200, 
    mpa_cutpoint = 2690, 
    vpa_cutpoint = 6167, 
    age = 32,
    weight = 67,
    sex = "male",
    )
summary_by_day <- recap_by_day(
    data = mydata_with_intensity_marks, 
    age = 32, 
    weight = 67, 
    sex = "male",
    valid_wear_time_start = "07:00:00",
    valid_wear_time_end = "22:00:00"
    )$df_all_metrics
average_results(data = summary_by_day, minimum_wear_time = 10)



[Package activAnalyzer version 2.0.2 Index]