GGIR error in g.part4 for gt3x doc

62 views
Skip to first unread message

Bianca Boi

unread,
Apr 24, 2024, 6:10:06 AMApr 24
to R package GGIR
Hello everyone,
I'm doing a study over 100 teenagers (around 13yr), they have worn GT3X+ accelerometer on their non dominant wrist, and I'm not able to use correctly the GGIR package to analyse the results... I'm having an error about g.part4 : Error in g.part4(datadir = datadir, metadatadir = metadatadir, f0 = f0, : object 'defaultGuider' not found
When I remove the part 4 from analysis it does work but there isn't that much results.

Here is my code :

GGIR(
  mode = c(1, 2, 3, 4, 5),
  datadir = "C:/Users/bianca.boi/OneDrive - Aix-Marseille Université/Stage OCAPI/Accéléro/GGIR/TEST",
  outputdir = "C:/Users/bianca.boi/OneDrive - Aix-Marseille Université/Stage OCAPI/Accéléro/GGIR/OUTPUT",
  studyname = "TEST",
  minimumFileSizeMB = 0,
  f0 = 1, #File index to start with (default = 1). Index refers to the filenames sorted in alphabetical order
  f1 = 0, #File index to finish with (defaults to number of files available, i.e., f1 = 0
  overwrite = FALSE, #if false skip the previously preocessed files (default)
  do.imp = TRUE, #default
  idloc = 1, #default = 1 assumes that the ID number is present in the accelerometer file header; if not try =2 (actigraph)
  print.filename = TRUE,
  storefolderstructure = TRUE,


#========================================
# PART 1
#========================================

  windowsizes = c(10, 900, 3600), # 10s epoch, 15 min non-wear resolution 60 min of non-wear #evaluation windows
  #sf = 30,
  do.cal = TRUE,
  do.anglez = TRUE,
  do.enmoa = TRUE,
  do.enmo = FALSE,
  acc.metric = "ENMOa",
  do.mad = FALSE,
  do.hfen = FALSE,
  do.en = FALSE,
  #chunksize = 1, #a way to tell GGIR to use less memory, which can be useful on machines with limited memory
  printsummary = TRUE,

#========================================
# PART 2
#========================================

  strategy = 1, # default, otherwise =2 only data beetween 1st & last midnight
  hrs.del.start = 0, #needed if strategy= 1; how many hours after start of data collection did wearing of monitor start ?
  hrs.del.end = 0, #same but before end of data collection
  maxdur = 0, #how many days after start of data collection did data collection end, by default or unknon : 0
  ndayswindow = 7, #used if strategy = 3  : it is the size of the window as number of days
  includedaycrit = 10, #minimum number of valid hours/days
  qwindow = c(0:24), # time windos over which all variables are calculated; can be multiple windows for segmented analysis; for hourly analysis use qwindow = c(0:24)
  mvpathreshold = c(75,250,750), #needed if including bout metrics (à voir pour ado quel seuil utiliser)
  mvpadur = c(1, 5, 10), # The bout duration(s) for which MVPA will be calculated
  boutcriter = c(0.8), # (default = 0.8). A number between 0 and 1, it defines what fraction of a bout (needs to be above the mvpathreshol)
  #bout.metric = 4,
  closedbout = FALSE,
  M5L5 = 10, #time resolution of the M5L5 analysis in minutes (default = 10)
  qM5L5 = c(0.1, 0.25, 0.5, 0.75, 0.9), #(default = NULL). Percentiles (quantiles) to be calculated over L5 and M5 window.
  winhr = c(1, 6), #(default = 5). Vector of window size(s) (unit: hours) of LX and MX analysis, where look for least and most active consecutive number of X hours.
  ilevels = c(0, 50, 100, 150, 200, 250, 300, 350, 700, 8000), #There is no limit to the number of levels. If left empty then the intensity levels will not be extracted. Distribution will be derived from short epoch metric data
  excludefirstlast = FALSE, #to ignore first and last night of analysis
  #includenightcrit = 16, #minimum number of valid hours/night
  iglevels = NULL, #(default = NULL). Levels for acceleration value frequency distribution in mg used for intensity gradient calculation.
  MX.ig.min.dur = 1, #IG calculated for least and most active continious periods (in hours) set by 'winhr'.Minimum, it has to be the <= the lowest winhr value. (default = 10). Minimum MX duration needed in order for intensity gradient to be calculated.
  qlevels = c(
    960/1440, #most active 3rds of the day
    1320/1440, #most active 120 min
    1380/1440, #most active 60 min
    1410/1440, #most active 30 min
    1425/1440, #most active 15 min
    1435/1440), #most active 5 min
  #these are the MX metrics (minimum acceleration (mg) for the most active accumulated X minutes); change the numerator and denominator depending on our qwindows value (ex: qwindows = c(7,23) => 960 min)

#=========================================
# PART 3 & 4 #include additional arguments if using sleep logs (to skip ?)
#=========================================
 
  timethreshold = 5, #time threshold in minutes for substainted periods of inactivity
  anglethreshold = 5, #angle threshold (degrees) for substained inactivity periods detections (default = 5)
  ignorenonwear = TRUE,
  def.noc.sleep = c(20, 9), #time window of substained inactivity assumed to be sleep when no sleep log available; can be set to time or sleep algo default 1 for van Hees et al algo.
  outliers.only = FALSE,
  criterror = 4, #relevant if sleep log used; see manual
  do.visual = TRUE,


#========================================
# PART5
#========================================

  #iglevels = TRUE,
  threshold.lig = c(87.5), # teen - AG wrist
  threshold.mod = c(250), # teen - AG wrist MPA défault = 100
  threshold.vig = c(750), # teen - AG wrist
  #boutcriter = 0.8, #number between 0 and 1 to decide what fraction of a bout must be above the intensity threshold
  boutcriter.in = 0.9,
  boutcriter.mod = 0.8,
  boutcriter.mvpa = 0.8,
  boutdur.in = c(1, 10, 30), # bout duration in minutes
  boutdur.lig = c(1, 10),
  boutdur.mvpa = c(1),
  timewindow = c("WW", 'MM'), #WW: waking up to waking up as approach for describing 24-hour time-use ; alternative is MM: midnight to midnight
  includedaycrit.part5 = 2/3, #Inclusion criteria for number of valid used in part , can be expressed as a ratio of 1 or as the number of hours in the qwindow period
  frag.metrics = "all",
  part5_agg2_60seconds = TRUE,

#==========================================
# Visual report
#==========================================

  do.report = c(1, 2, 3, 4, 5),
  visualreport = TRUE,
  dofirstpage = TRUE,
  epochvalues2csv = TRUE, # generates csv file with time-stamped epoch-level acceleration and anglez values
  viewingwindow = 1,

)

Thanks for your answer,
Bests regards!

Bianca.

Michael Rueschman

unread,
Apr 24, 2024, 11:42:50 AMApr 24
to R package GGIR
What version of GGIR are you using? There was an issue (https://github.com/wadpac/GGIR/issues/1095) around defaultGuider that was resolved recently.

You could try installing the latest GGIR (3-0.10 as of today) from GitHub using these commands. The latest release includes the fix for this issue.

install.packages("remotes") remotes::install_github("wadpac/GGIR")
Reply all
Reply to author
Forward
0 new messages