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
g.impute.RdFunctions takes the output from g.getmeta and information about the study protocol to label impute invalid time segments in the data.
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
Examples
if (FALSE) {
#inspect file:
I = g.inspectfile(datafile)
#autocalibration:
C = g.calibrate(datafile)
#get meta-data:
M = g.getmeta(datafile)
}
data(data.getmeta)
data(data.inspectfile)
#impute meta-data:
IMP = g.impute(M=data.getmeta, I=data.inspectfile)