applyExtFunction: Apply external function to acceleration data.

View source: R/applyExtFunction.R

applyExtFunctionR Documentation

Apply external function to acceleration data.

Description

Applies external function to the raw acceleration data within GGIR. This makes it easier for new algorithms developed to be pilotted on accelerometer data while taking advantage of the existing comprehensive GGIR data management and analysis infrastructure. This function is not for direct interaction by user, please supply object myfun to GGIR or g.part1. Object myfun is a list as detailed below.

Usage

  applyExtFunction(data, myfun, sf, ws3, interpolationType=1)
  

Arguments

data

Data data.frame as present internally in g.getmeta. It has at least four columns of which the first is the timestamp followed by the x, y, and z acceleration.

myfun

See details, in short: myfun is a list object that holds the external function to be applied to the data and various parameters to aid in the process.

sf

Sample frequency (Hertz) of the data object

ws3

Short epoch size (first value of windowsizes in g.getmeta).

interpolationType

Integer to indicate type of interpolation to be used when resampling time series (mainly relevant for Axivity sensors), 1=linear, 2=nearest neighbour.

Details

See package vignette for detailed tutorial with examples on how to use the function embedding: https://cran.r-project.org/web/package=GGIR/vignettes/applyExtFunction.pdf Function applyExtFunction is typically not used by the GGIR user directly.

Value

The output of the external algorithm aggregated or repeated to fit the short epoch length of GGIR. Therefore, the short epoch length of GGIR should be a multitude of the resolution of the external function output, or visa versa.

Author(s)

Vincent T van Hees <v.vanhees@accelting.com>


GGIR documentation built on April 3, 2025, 6 p.m.