compute_intensity_distri_metrics {activAnalyzer}R Documentation

Compute intensity distribution metrics

Description

This function computes metrics that describe the distribution of intensity for each day of a dataset. Computations are performed based on the daily periods set for analysis and on the detected wear time.

Usage

compute_intensity_distri_metrics(
  data,
  col_axis = "vm",
  col_time = "time",
  valid_wear_time_start = "00:00:00",
  valid_wear_time_end = "23:59:59",
  start_first_bin = 0,
  start_last_bin = 10000,
  bin_width = 500
)

Arguments

data

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

col_axis

A character value to indicate the name of the variable to be used to compute total time per bin of intensity.

col_time

A character value to indicate the name of the variable to be used to determine the epoch length of the dataset.

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.

start_first_bin

A numeric value to set the lower bound of the first bin of the intensity band (in counts/epoch duration).

start_last_bin

A numeric value to set the lower bound of the last bin of the intensity band (in counts/epoch duration).

bin_width

A numeric value to set the width of the bins of the intensity band (in counts/epoch duration).

Value

A list of objects: metrics, p_band, and p_log. metrics is a dataframe containing the intensity gradients and the MX metrics (in counts/epoch duration used) as described in Rowlands et al. (2018; doi:10.1249/MSS.0000000000001561). The graphic p_band shows the distribution of time spent in the configured bins of intensity for each day of the dataset. The graphic p_log shows, for each day, the relationship between the natural log of time spent in each bin with the natural log of the middle values of the intensity bins.

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_intensity_distri_metrics(
   data = mydata_with_intensity_marks,
   col_axis = "vm",
   col_time = "time",
   valid_wear_time_start = "00:00:00",
   valid_wear_time_end = "23:59:59",
   start_first_bin = 0,
   start_last_bin = 10000,
   bin_width = 500
    )
 


[Package activAnalyzer version 2.1.1 Index]