-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cookbook vignette with illustration of how to use NotWorn #1137
- Loading branch information
1 parent
fb16c3e
commit 621f382
Showing
4 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
title: "Cookbook" | ||
output: | ||
html_document: | ||
toc: true | ||
number_sections: true | ||
toc_depth: 3 | ||
toc_float: true | ||
urlcolor: blue | ||
vignette: > | ||
%\VignetteIndexEntry{GGIR output} | ||
\usepackage[utf8]{inputenc} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
--- | ||
|
||
In this cook book you will find recipes for using GGIR in specific scenarios. | ||
|
||
# Handling externally derived data | ||
|
||
## Actiwatch data | ||
|
||
### in .AWD format | ||
|
||
``` | ||
GGIR(datadir = "/media/actiwatch_awd", # folder with epoch level .AWD file | ||
outputdir = "/media/myoutput", | ||
dataFormat = "actiwatch_awd", | ||
extEpochData_timeformat = "\%m/\%d/\%Y \%H:\%M:\%S", | ||
windowsizes = c(60, 900, 3600), # 60 is the expected epoch length | ||
HASIB.algo = "Sadeh1994", | ||
def.noc.sleep = c()) # <= because we cannot use HDCZA for ZCY | ||
``` | ||
|
||
### in .CSV format | ||
|
||
``` | ||
GGIR(datadir = "/media/actiwatch_csv", # folder with epoch level .AWD file | ||
outputdir = "/media/myoutput", | ||
dataFormat = "actiwatch_csv", | ||
extEpochData_timeformat = "\%m/\%d/\%Y \%H:\%M:\%S", | ||
windowsizes = c(15, 900, 3600), # 15 is the expected epoch length | ||
HASIB.algo = "Sadeh1994", | ||
def.noc.sleep = c()) # <= because we cannot use HDCZA for ZCY | ||
``` | ||
|
||
## UK Biobank data in .CSV format | ||
|
||
``` | ||
GGIR(datadir = "/media/ukbiobank", | ||
outputdir = "/media/myoutput", | ||
dataFormat = "ukbiobank_csv", | ||
extEpochData_timeformat = "\%m/\%d/\%Y \%H:\%M:\%S", | ||
windowsizes = c(5, 900, 3600), # We know that data was stored in 5 second epoch | ||
desiredtz = "Europe/London") # We know that data was collected in the UK | ||
``` | ||
|
||
## ActiGraph count data in .CSV format | ||
|
||
``` | ||
GGIR(datadir = "/examplefiles", | ||
outputdir = "", | ||
dataFormat = "actigraph_csv", | ||
windowsizes = c(5, 900, 3600), | ||
threshold.in = round(100 * (5/60), digits = 2), | ||
threshold.mod = round(2500 * (5/60), digits = 2), | ||
threshold.vig = round(10000 * (5/60), digits = 2), | ||
extEpochData_timeformat = "\%m/\%d/\%Y \%H:\%M:\%S", | ||
do.neishabouricounts = TRUE, | ||
acc.metric = "NeishabouriCount_x") | ||
``` | ||
|
||
## Senwear data in .xls format | ||
|
||
``` | ||
GGIR(datadir = "C:/yoursenseweardatafolder", | ||
outputdir = "D:/youroutputfolder", | ||
windowsizes = c(60, 900, 3600), | ||
threshold.in = 1.5, | ||
threshold.mod = 3, | ||
threshold.vig = 6, | ||
dataFormat = "sensewear_xls", | ||
extEpochData_timeformat = "\%d-\%b-\%Y \%H:\%M:\%S", | ||
HASPT.algo = "NotWorn") | ||
``` | ||
|
||
# Handling study protocol | ||
|
||
## Not worn during night | ||
|
||
Data type: Any | ||
Study protocol: Worn during the day, taken off during the night | ||
Wear location: Any | ||
|
||
``` | ||
GGIR(HASPT.algo = "NotWorn", | ||
HASIB.algo = "NotWorn", | ||
do.imp = FALSE, # Do not impute nonwear because sensor was never worn 24/7 | ||
HASPT.ignore.invalid = NA, # Treat nonwear as potential part of guider window | ||
ignorenonwear = FALSE, # Consider nonwear as potential sleep | ||
relyonguider = TRUE, # has minor influence | ||
includenightcrit = 8, | ||
includedaycrit = 8) | ||
``` |