This R script will generate all necessary R/Rmd/shell files for data processing after running GGIR for accelerometer data.
afterggir(
mode,
useIDs.FN = NULL,
currentdir,
studyname,
bindir = NULL,
outputdir,
epochIn = 5,
epochOut = 5,
flag.epochOut = 60,
log.multiplier = 9250,
use.cluster = TRUE,
QCdays.alpha = 7,
QChours.alpha = 16,
QCnights.feature.alpha = c(0, 0),
Rversion = "R",
filename2id = NULL,
PA.threshold = c(50, 100, 400),
desiredtz = "US/Eastern",
RemoveDaySleeper = FALSE,
part5FN = "WW_L50M100V400_T5A5",
NfileEachBundle = 20,
trace = FALSE
)
number
Specify which of the five parts need to be run, e.g. mode = 0 makes that all R/Rmd/sh files are generated for other parts. When mode = 1, all csv files in the GGIR output directory were read, transformed and then merged. When mode = 2, the GGIR output files were checked and summarized in one excel sheet. When mode = 3, the merged data was cleaned according to the number of valid hours on each night and the number of valid days for each subject. When mode = 4, the cleaned data was imputed.
character
Filename with or without directory for sample information in CSV format, which including "filename" and "duplicate" in the headlines at least. If duplicate="remove", the accelerometer files will not be used in the data analysis of part 5-7. Defaut is NULL, which makes all accelerometer files will be used in part 5-7.
character
Directory where the output needs to be stored. Note that this directory must exist.
character
Specify the study name that used in the output file names
character
Directory where the accelerometer files are stored or list
character
Directory where the GGIR output was stored.
number
Epoch size to which acceleration was averaged (seconds) in GGIR output. Defaut is 5 seconds.
number
Epoch size to which acceleration was averaged (seconds) in part1. Defaut is 5 seconds.
number
Epoch size to which acceleration was averaged (seconds) in part 3. Defaut is 60 seconds.
number
The coefficient used in the log transformation of the ENMO data, i.e. log( log.multiplier * ENMO + 1), which have been used in part 5-7. Defaut is 9250.
logical
Specify if part1 will be done by parallel computing. Default is TRUE, and the CSV file in GGIR output will be merged for every 20 files first, and then combined for all.
number
Minimum required number of valid days in subject specific analysis as a quality control step in part2. Default is 7 days.
number
Minimum required number of valid hours in day specific analysis as a quality control step in part2. Default is 16 hours.
number
Minimum required number of valid nights in day specific mean and SD analysis as a quality control step in the JIVE analysis. Default is c(0,0), i.e. no additional data cleaning in this step.
character
R version, eg. "R/3.6.3". Default is "R".
R function
User defined function for converting filename to sample IDs. Default is NULL.
number
Threshold for light, moderate and vigorous physical activity. Default is c(50,100,400).
charcter
desired timezone: see also http://en.wikipedia.org/wiki/Zone.tab. Used in g.inspectfile(). Default is "US/Eastern". Used in g.inspectfile() function to inspect acceleromether file for brand, sample frequency in part 2.
logical
Specify if the daysleeper nights are removed from the calculation of number of valid days for each subject. Default is FALSE.
character
Specify which output is used in the GGIR part5 results. Defaut is "WW_L50M100V400_T5A5", which means that part5_daysummary_WW_L50M100V400_T5A5.csv and part5_personsummary_WW_L50M100V400_T5A5.csv are used in the analysis.
number
Number of files in each bundle when the csv data were read and processed in a cluster. Default is 20.
logical
Specify if the intermediate results is printed when the function was executed. Default is FALSE.
See postGGIR manual for details.