Learn R Programming

GGIR (version 1.4)

g.impute: 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, strategy = 1, hrs.del.start = 0, hrs.del.end = 0, maxdur = 0, ndayswindow = 7,desiredtz="Europe/London")

Arguments

M
output from g.getmeta
I
output from g.inspectfile
strategy
how to deal with knowledge about study protocol. value = 1 means select data based on hrs.del.start, hrs.del.end, and maxdur. Value = 2 makes that only the data between the first midnight and the last midnight is used for imputation. Value = 3 only selects the most active X days in the files. X is specified by argument ndayswindow
hrs.del.start
how many HOURS after start of experiment did wearing of monitor start?
hrs.del.end
how many HOURS before the end of the experiment did wearing of monitor definitely end?
maxdur
How many DAYS after start of experiment did experiment definitely stop? (set to zero if unknown = default)
ndayswindow
If strategy is set to 3 then this is the size of the window as a number of days
desiredtz
see g.getmeta

Value

Examples

Run this code
## 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)

Run the code above in your browser using DataLab