calibrate: Calibrate Accelerometer Data using GGIR

View source: R/calibrate.R

estimate_calibration_valuesR Documentation

Calibrate Accelerometer Data using GGIR

Description

Calibrate Accelerometer Data using GGIR

Usage

estimate_calibration_values(
  file,
  verbose = TRUE,
  fix_zeros = TRUE,
  fill_in = TRUE,
  by_second = FALSE,
  trim = FALSE,
  ...
)

calibrate(
  file,
  verbose = TRUE,
  fix_zeros = TRUE,
  fill_in = TRUE,
  by_second = FALSE,
  trim = FALSE,
  round_after_calibration = TRUE,
  ...
)

Arguments

file

Either a GT3X file, 'AccData' object, or 'data.frame' with 'X/Y/Z' and 'time'

verbose

print diagnostic messages, higher number result in higher verbosity

fix_zeros

Should fix_zeros be run before calculating the measures?

fill_in

if fix_zeros = TRUE, should the zeros be filled in with the last

by_second

Should the last observation carried forward be done only within the same second?

trim

if fix_zeros = TRUE, should the time course be trimmed for zero values at the beginning and the end of the time course? observation carried forward?

...

Additional arguments to pass to g.calibrate

round_after_calibration

Should the data be rounded after calibration? Will round to 3 digits

Value

A set of calibration coefficients

Examples

## Not run: 
  index = 2
  files = read.gt3x::gt3x_datapath(index)
  if (all(is.na(files))) {
    files = file.path(tempdir(), ".read.gt3x-data",
                      read.gt3x::gt3x_filename(index))
  }
  path = files[1]
  res = read_actigraphy(path)
  res = fix_zeros(res)
  cab = calibrate(res)

## End(Not run)

muschellij2/SummarizedActigraphy documentation built on April 9, 2024, 8:32 a.m.