g.part3: Detection of sustained inactivity periods as needed for sleep...

Description Usage Arguments Value Author(s) References Examples

View source: R/g.part3.R

Description

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.

Usage

1
2
3
g.part3(metadatadir=c(),f0,f1,anglethreshold = 5,timethreshold = 5,acc.metric="ENMO",
  ignorenonwear=FALSE,overwrite=FALSE,desiredtz="Europe/London",constrain2range=TRUE,
  do.part3.pdf=TRUE)

Arguments

metadatadir

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.

f0

File index to start with (default = 1). Index refers to the filenames sorted in increasing order

f1

File index to finish with (defaults to number of files available)

anglethreshold

Angle threshold (degrees) for sustained inactivity periods detection, default = 5

timethreshold

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)

acc.metric

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)

ignorenonwear

If TRUEE then ignore detected monitor non-wear periods to avoid confusion between monitor non-wear time and sustained inactivity (default = TRUE)

overwrite

Overwrite previously generated milestone data by this function for this particular dataset? If FALSE then it will skip the previously processed files (default = FALSE).

desiredtz

See g.getmeta

constrain2range

Whether or not to constrain the range of threshold used in the diary free Sleep period time window detection

do.part3.pdf

Whether to generate a pdf for part 3 (default is TRUE). Turning this off could speed up the processing.

Value

The function provides no values, it only ensures that other functions are called and that their output is stored in .RData files.

Author(s)

Vincent T van Hees <vincentvanhees@gmail.com>

References

Examples

1
2
3
4
5
6
## 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)

## End(Not run)

PeteJWatson/ggircal documentation built on Nov. 24, 2021, 11:14 a.m.