recap_by_day {activAnalyzer}R Documentation

Summarize results by day

Description

This function summarizes various accelerometer metrics for each day of the measurement period.

Usage

recap_by_day(
  data,
  col_axis = "vm",
  col_time = "time",
  col_nonwear = "non_wearing_count",
  col_wear = "wearing_count",
  valid_wear_time_start = "00:00:00",
  valid_wear_time_end = "23:59:59",
  age = 40,
  weight = 70,
  sex = c("male", "female", "intersex", "undefined", "prefer not to say"),
  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 and then intensity gradient.

col_time

A character value indicating the name of the variable where time information is provided.

col_nonwear

A character value to indicate the name of the variable used to count nonwear time.

col_wear

A character value to indicate the name of the variable used to count wear time.

valid_wear_time_start

A character value with the HH:MM:SS format to set the start of the daily period to consider for computing valid wear time.

valid_wear_time_end

A character value with the HH:MM:SS format to set the end of the daily period to consider for computing valid wear time.

age

A numeric value in yr.

weight

A numeric value in kg.

sex

A character value.

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).

Details

The following metrics are computed from epochs corresponding to valid wear time:

PAL is computed by dividing total energy expenditure (TEE) by BMR. TEE is obtained by summing the kilocalories computed for wear time epochs and the kilocalories related to BMR theoretically expended during nonwear time epochs (it is assumed that the periods where the device was not worn corresponded to sleeping periods, during which energy expenditure is near of BMR), and by multiplying this sum by 10/9 to take into account the thermic effect of food. Of course, such calculations may conduct to underestimate TEE and PAL if the device was removed during prolonged periods of physical activity. Moreover, even if the device was correctly worn, the estimate of PAL is very approximate since both BMR and kilocalories are estimated using methods that may not be accurate at the individual level.

The intensity gradient and the MX metrics are obtained using the compute_intensity_distri_metrics function.

Value

A list of objects: df_all_metrics, p_band, and p_log. df_all_metrics is a dataframe containing all the metrics for each day. p_band is a figure that shows the distribution of time spent in the configured bins of intensity for each day of the dataset. p_log is a figure that shows, for each day, the relationship between the natural log of time spent in each intensity 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"
    )
recap_by_day(
    data = mydata_with_intensity_marks, 
    col_axis = "vm",
    age = 32, 
    weight = 67, 
    sex = "male",
    valid_wear_time_start = "07:00:00",
    valid_wear_time_end = "22:00:00",
    start_first_bin = 0,
    start_last_bin = 10000,
    bin_width = 500
    )



[Package activAnalyzer version 2.0.2 Index]