create_flextable_summary {activAnalyzer}R Documentation

Create a formatted table of results

Description

The function generates a formatted table with both means and medians of the metrics obtained following the physical behavior measurement.

Usage

create_flextable_summary(
  results_summary_means,
  results_summary_medians,
  language = c("en", "fr"),
  metrics = c("all", "volume", "step_acc", "int_distri"),
  epoch_label = "60s"
)

Arguments

results_summary_means

A dataframe with mean results obtained using the prepare_dataset, mark_wear_time, mark_intensity, recap_by_day, and then the average_results functions.

results_summary_medians

A dataframe with median results obtained using the prepare_dataset, mark_wear_time, mark_intensity, recap_by_day, and then the average_results functions.

language

A character value for setting the language with which the figure should be created: en for english; fr for french.

metrics

A character value for setting the metrics to be shown in the figure. "volume" refers to "activity volume" metrics, step_acc" refers to "step accumulation" metrics, and "int_distri" refers to intensity distribution metrics. By default, the function provides all computed metrics.

epoch_label

A character value to be pasted into the names of the variables to build the figure

Value

A flextable object

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", 
    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
results_summary_means <- average_results(
    data = summary_by_day, 
    minimum_wear_time = 10, 
    fun = "mean"
    )
results_summary_medians <- average_results(
    data = summary_by_day, 
    minimum_wear_time = 10, 
    fun = "median"
    )
create_flextable_summary(
    results_summary_means,
    results_summary_medians, 
    language = "en"
    )



[Package activAnalyzer version 2.0.2 Index]