View source: R/calculate_measures.R
calculate_activity_counts | R Documentation |
Calculate Summary Measures from Raw Accelerometer Data
calculate_activity_counts(
df,
sample_rate = NULL,
unit = "1 min",
verbose = TRUE,
...
)
calculate_ac(df, sample_rate = NULL, unit = "1 min", verbose = TRUE, ...)
calculate_measures(
df,
unit = "1 min",
fix_zeros = TRUE,
fill_in = TRUE,
by_second = FALSE,
trim = FALSE,
dynamic_range = NULL,
calculate_mims = TRUE,
calculate_ac = TRUE,
flag_data = TRUE,
flags = NULL,
ensure_all_time = TRUE,
verbose = TRUE,
sample_rate = NULL,
...
)
calculate_ai(df, unit = "1 min", ensure_all_time = TRUE, verbose = FALSE)
calculate_activity_index(
df,
unit = "1 min",
ensure_all_time = TRUE,
verbose = FALSE
)
calculate_flags(df, unit = "1 min", ensure_all_time = TRUE)
calculate_n_idle(df, unit = "1 min", ensure_all_time = TRUE)
calculate_enmo(...)
calculate_ai_defined(...)
calculate_mad(df, unit = "1 min", ensure_all_time = TRUE, verbose = FALSE)
get_sample_rate(df, sample_rate = NULL)
calculate_auc(
df,
unit = "1 min",
sample_rate = NULL,
allow_truncation = FALSE,
ensure_all_time = TRUE,
verbose = TRUE
)
calculate_fast_mims(
df,
unit = "1 min",
dynamic_range = NULL,
sample_rate = NULL,
allow_truncation = TRUE,
ensure_all_time = TRUE,
verbose = TRUE,
...
)
calculate_mims(
df,
unit = "1 min",
dynamic_range = c(-6, 6),
ensure_all_time = TRUE,
...
)
df |
An object with columns 'X', 'Y', and 'Z' or an object of class 'AccData' |
sample_rate |
sample rate of data, if not specified in header of object |
unit |
length of time to calculate measures over. a character string
specifying a time unit or a multiple of a unit to be rounded to.
Valid base units are 'second', 'minute', 'hour', 'day', 'week', 'month',
'bimonth', 'quarter', 'season', 'halfyear', and 'year'.
Arbitrary unique English abbreviations as in the |
verbose |
print diagnostic messages |
... |
additional arguments to pass to [MIMSunit::mims_unit] |
fix_zeros |
Should |
fill_in |
if |
by_second |
Should the last observation carried forward be done only within the same second? |
trim |
if |
dynamic_range |
Dynamic range of the device, in gravity units |
calculate_mims |
Should MIMS units be calculated? |
calculate_ac |
Should Activity Counts from the |
flag_data |
Should [SummarizedActigraphy::flag_qc()] be run?
It will be executed after |
flags |
the flags to calculate, passed to [SummarizedActigraphy::flag_qc()] |
ensure_all_time |
if |
allow_truncation |
truncate small values |
A data set with the calculated features
file = system.file("extdata", "TAS1H30182785_2019-09-17.gt3x",
package = "SummarizedActigraphy")
res = read_actigraphy(file)
measures = calculate_measures(res, dynamic_range = NULL,
calculate_mims = FALSE)
auc = calculate_auc(res)
mims = calculate_mims(res, dynamic_range = NULL)
if (requireNamespace("data.table", quietly = TRUE)) {
dt = data.table::as.data.table(res$data)
out = calculate_measures(dt, calculate_mims = FALSE, flag_data = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.