compute_accumulation_metrics {activAnalyzer}R Documentation

Compute activity accumulation metrics

Description

This function computes metrics that summarise the pattern of accumulation of either sedentary behaviour or physical activity (depending on the configuration of the function) over time:

The appearance of the graphics generated by the function has been inspired by the supplementary file provided by Belletiere al. (2017; doi:10.1371/journal.pone.0180119).

Usage

compute_accumulation_metrics(
  data,
  col_time = "time",
  col_cat_int = "intensity_category",
  behaviour = c("sed", "pa"),
  dates = NULL,
  valid_wear_time_start = "00:00:00",
  valid_wear_time_end = "23:59:59",
  zoom_from = "00:00:00",
  zoom_to = "23:59:59"
)

Arguments

data

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

col_time

A character value to indicate the name of the variable containing time data.

col_cat_int

A character value indicating the name of the variable where intensity category (SED, LPA, MVPA) is provided.

behaviour

A character value indicating whether metrics should be computed for sedentary behaviour or physical activity.

dates

A character vector containing the dates to be retained for analysis. The dates must be with the "YYYY-MM-DD" format. Default is NULL.

valid_wear_time_start

A character value with the HH:MM:SS format to set the start of the daily period that will be considered for computing metrics.

valid_wear_time_end

A character value with the HH:MM:SS format to set the end of the daily period that will be considered for computing metrics.

zoom_from

A character value with the HH:MM:SS format to set the start of the daily period to visualize regarding the daily breaks.

zoom_to

A character value with the HH:MM:SS format to set the end of the daily period to visualize regarding the daily breaks.

Value

A list of numeric and graphic objects related to mean daily total breaks, alpha, MBD, UBD and Gini index. The list also contains the processed datasets that were used to provide these metrics: recap_bouts_by_day used to compute mean_break, recap_bouts used to compute alpha and MBD, summarised_bouts used to compute UBD, and summarised_bouts2 used to compute ⁠Gini index⁠.

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",
    )
compute_accumulation_metrics(
   data = mydata_with_intensity_marks,
   behaviour = "sed",
   dates = c("2021-04-07", "2021-04-08", "2021-04-09", "2021-04-10", "2021-04-11"),
   valid_wear_time_start = "00:00:00",
   valid_wear_time_end = "23:59:59",
   zoom_from = "00:00:00",
   zoom_to = "23:59:59"
    )



[Package activAnalyzer version 2.1.1 Index]