g.impute: Function to identify invalid periods in the meta-data as...

View source: R/g.impute.R

g.imputeR Documentation

Function to identify invalid periods in the meta-data as generated by g.getmeta and to impute these invalid periods with the average of similar timepoints on other days of the measurement

Description

Functions takes the output from g.getmeta and information about the study protocol to label impute invalid time segments in the data.

Usage

  g.impute(M, I, params_cleaning = c(),
  desiredtz="", dayborder= 0, TimeSegments2Zero =c(), acc.metric = "ENMO", ...)

Arguments

M

output from g.getmeta

I

output from g.inspectfile

params_cleaning

See g.part1

desiredtz

See g.part1

dayborder

See g.part1

TimeSegments2Zero

Optional data.frame to specify which time segments need to be ignored for the imputation, and acceleration metrics to be imputed by zeros. The data.frame is expected to contain two columns named windowstart and windowend, with the start- and end time of the time segment in POSIXlt class.

acc.metric

See GGIR

...

Any argument used in the previous version of g.impute, which will now be used to overrule the arguments specified with the parameter objects.

Value

metashort

imputed short epoch variables

rout

matrix to clarify when data was imputed for each long epoch time window and the reason for imputation. Value = 1 indicates imputation. Columns 1 = monitor non wear, column 2 = clipping, column 3 = additional nonwear, column 4 = protocol based exclusion and column5 = sum of column 1,2,3 and 4.

averageday

matrix with n columns for n metrics values and m rows for m short epoch time windows in an average 24 hours period

Author(s)

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

Examples

  ## Not run: 
    #inspect file:
    I = g.inspectfile(datafile)
    #autocalibration:
    C = g.calibrate(datafile) 
    #get meta-data:
    M = g.getmeta(datafile)
  
## End(Not run)
  data(data.getmeta)
  data(data.inspectfile)
  #impute meta-data:
  IMP = g.impute(M=data.getmeta, I=data.inspectfile)

GGIR documentation built on Oct. 17, 2023, 1:12 a.m.