Function called by g.shell.GGIR. It estimates the sustained inactivity periods in each day, which are used as input for g.part4 which then labels them as nocturnal sleep or day time sustained inactivity periods. Typical users should work with function g.shell.GGIR only.
g.part3(metadatadir=c(),f0,f1,anglethreshold = 5,timethreshold = 5,
acc.metric="ENMO", ignorenonwear=TRUE, overwrite=FALSE,
desiredtz="",constrain2range=TRUE,
do.part3.pdf=TRUE, do.parallel=TRUE, myfun=c(), maxNcores=c(),
sensor.location="wrist", HASPT.algo="HDCZA", HASIB.algo = "vanHees2015",
Sadeh_axis = "Y", longitudinal_axis=c(), HASPT.ignore.invalid=FALSE)
Directory that holds a folder 'meta' and inside this a folder 'basic' which contains the milestone data produced by g.part1. The folderstructure is normally created by g.part1 and g.shell.GGIR will recognise what the value of metadatadir is.
File index to start with (default = 1). Index refers to the filenames sorted in increasing order
File index to finish with (defaults to number of files available)
Angle threshold (degrees) for sustained inactivity periods detection, default = 5
Time threshold (minutes) for sustained inactivity periods detection, default = 5. This can be specified as multiple thresholds, each of which will be implemented. For example, timethreshold = c(5,10)
Which one of the metrics do you want to consider to analyze L5. The metric of interest need to be calculated in M (see g.part1)
If TRUE then ignore detected monitor non-wear periods to avoid confusion between monitor non-wear time and sustained inactivity (default = TRUE)
Overwrite previously generated milestone data by this function for this particular dataset? If FALSE then it will skip the previously processed files (default = FALSE).
See g.getmeta
Whether or not to constrain the range of threshold used in the diary free Sleep period time window detection
Whether to generate a pdf for part 3 (default is TRUE). Turning this off could speed up the processing.
Boolean whether to use multi-core processing (only works if at least 4 CPU cores are available.
External function object to be applied to raw data. See details applyExtFunction.
See function g.part1
Character to indicate sensor location, default is wrist. If it is hip HDCZA algorithm also requires longitudinal axis of sensor to be between -45 and +45 degrees.
Character to indicate what heuristic algorithm to use for detecting the SPT window, see HASPT
Character to indicate what heuristic algorithm to use for detecting the SIB window, see HASIB
Character to indicated which axis to use for Sadeh algorithm, see HASIB
Integer, see g.sib.det
See HASPT
The function provides no values, it only ensures that other functions are called and that their output is stored in .RData files.
night
nightnumber
definition
definition of sustained inactivity. For example,
T10A5 refers to 10 minute window and a 5 degree angle (see paper for
further explaination).
start.time.day
timestamp when the day started
nsib.periods
number of sustained inactivity bouts
tot.sib.dur.hrs
total duration of all sustained inactivity bouts
fraction.night.invalid
fraction of the night for which
accelerometer data was invalid, e.g. monitor not worn
sib.period
number of sustained inactivity period
sib.onset.time
onset time of sustained inactivity period
sib.end.time
end time of sustained inactivity period
van Hees VT, Sabia S, et al. (2015) A novel, open access method to assess sleep duration using a wrist-worn accelerometer, PLoS ONE, November 2015
van Hees VT, Sabia S, et al. (2018) Estimating sleep parameters using an accelerometer without sleep diary. Scientific Reports.
# NOT RUN {
metadatadir = "C:/myfolder/meta" # assumes that there is a subfolder in
# metadatadir named 'basic' containing the output from g.part1
g.part3(metadatadir=metadatadir, anglethreshold=5,
timethreshold=5, overwrite=FALSE)
# }
Run the code above in your browser using DataLab