I am still having the below warning messages and some of the files are not processing after part 2.
library(GGIR)
library(bitops)
library(covr)
library(testthat)
library(knitr)
library(rmarkdown)
library(data.table)
library(Rcpp)
library(foreach)
library(doParallel)
library(signal)
library(zoo)
library(matlab)
library(GENEAread)
library(tuneR)
library(unisensR)
library(ineq)
library(stats)
library(utils)
#========================================
#General parameters
#========================================
g.shell.GGIR(
mode = c(1:5),
datadir = c("~/Desktop/GGIR/TEST"),
outputdir = c("~/Desktop/GGIR/OUTPUT"),
studyname = c("TEST"),
f0 = 1,
f1 = 14,
overwrite = TRUE, #Overwrite previously generated milestone
#IF FALSE then it will skip the previously processed files
do.imp = TRUE,
print.filename = TRUE,
storefolderstructure = TRUE,
#=======================================
#Part 1
#=======================================
windowsizes = c(10, 900, 3600), #10 s epoch, 15 min non-wear
do.cal = TRUE,
do.anglez = TRUE,
do.enmo = TRUE,
do.mad = FALSE,
do.hfen = FALSE,
do.en = FALSE,
chunksize = 1,
printsummary = TRUE,
#========================================
#Part 2
#========================================
strategy = 3, #see manual p43; '2' = only data between 1st and last midnight used for imputation
hrs.del.start = 0, #needed if 'strategy'=1; how many hours after start of data collection did wearing
hrs.del.end = 0, #needed if 'strategy'=1; how many hours before end of data collection did wearnig of
maxdur = 0, #how many days after start of data collection did data collection end; 0 is default if unknown
ndayswindow = 7, #used if 'strategy'=3 ; it is size of the window as number of days
includedaycrit = 10, #minimum number of valid hours/day
qwindow = c(0,24), #time windows over which all variables are calculated; can be multiple windows for seg
#for hourly analysis use qwindow = c(0:24),
mvpathreshold = c(35.6, 191.6, 695.8), #needed if including bout metrics ; can be multiple value: mvpathreshold =
mvpadur = c(1,5,10),
boutcriter = c(0.8),
bout.metric = 4, #see manual p35 (there are 6 options)
closedbout = FALSE,
M5L5res = 10, #time resolution of M5L5 analyses in minutes (default = 10 mins)
qM5L5 = c(0.1, 0.25, 0.5, 0.75, 0.9), #percentiles to be calculated over L5 and M5 window
winhr = c(1,6), #mp during most and least active continuous x hrs of the day (continous MX metrics)
#these period (can be < 1.....so 0.5 would be 30 minutes); it can be multiple values: winhr = c(5,10)
ilevels = c(0,50,100,150,200,250,300,350,700,8000), #user-defined acceleration bins - useful for
xcludefirstlast = TRUE, #to ignore 1st and last night of measurement for sleep analysis
includenightcrit = 10, #minimum nu mber of valis hours /night
iglevels = TRUE, #IG calculated as described in original Rowlands et al. (2018)
MX.ig.min.dur = 1, #IG calcuated for least and most active continous periods (in hours ) set by 'winhr'
#values must be <= the lowest 'winhr' values
qlevels = c(
960/1440, #most active 2/3rds of the day
1320/1440, #most active 120 mins
1380/1440, #most active 60 mins
1414/1440, #most active 30 mins
1425/1440, #most active 15 mins
1435/1440), #most active 5 mins
#these are the MX metrics (minimun acceleration (mg) for the most active accumulated X minutes); change..
#denominator values, depending on qwindows duration(e.g., qwindows = c(7,23) for waking hours totals 960
#========================================
# Part 3 + 4 #include additional arguments if using sleep logs (pp. 56-61 in manual)
#========================================
timethreshold = 5, #time threshold in minutes for sustained periods of inactivity
anglethreshold = 5, #angle threshold (degrees) for sustained inactivity periods detection (default = 5)
ignorenonwear = TRUE,
def.noc.sleep = 1, #time window of sustained inactivity periods detection (default = 5)
#can be set to times (def.noc.sleep = c(21,8)), or set to a sleep algorithm (1 is default based on van H)
outliers.only = FALSE,
criterror = 4, #relevant if sleep log used; see manual p.60
do.visual = TRUE,
#========================================
#Part 5
#========================================
iglevels = TRUE,
#winhr = c(1), #set for mg during most and least active consecutive x hrs of the day plus start time of
#(can be < 1.....so 0.5 would be 30 minutes for least and most active continuoys period analysis
#M5L5res = c(60), #resolution of time in minutes for least and most active continous period analysis
threshold.lig = c(35.6), #Child - AG wrist
threshold.mod = c(191.6), #Child = AG wrist
threshold.vig = c(695.8),
boutcriter = 0.8, #number between 0 and 1 define what fraction of a bout needs to be above the intense
boutcriter.in = 0.9,
boutcriter.lig = 0.8,
boutcriter.mvpa = 0.8,
boutdur.in = c(10,20,30), #bout durations in minutes
boutdur.lig = c(1,5,10),
boutdur.mvpa = c(1,5,10),
timewindow = c("WW", "MM"), #WW: waking up to waking up as approach for describing 24-hour time-use;
#alternative is MM: midnight to midnight ; sleep output does difer depending on which 'timewindow' is
includedaycrit.part5 = 2/3, #inclusion criteria for number of valid used in part 5; can be expressed as
#or as the number of hours in the qwindow period #Only used in this function if save_ms5rawlevels is TRUE
#as it only affects the time series files stored
frag.metrics = "all",
part5_agg2_60seconds = TRUE,
#=======================================
#Visual report
#=======================================
do.report = c(1:5),
visualreport = FALSE,
dofirstpage = TRUE,
epochvales2csv = TRUE, #generates csv file with time-stamped epoch-level acceleration & angle-2 values
viewingwindow = 1)