Extracting Lux Data in Axivity csv File

24 views
Skip to first unread message

Rosalind Ge

unread,
Apr 28, 2025, 2:37:34 AMApr 28
to R package GGIR

Hello everyone,

I’m currently working with GGIR for accelerometer data analysis and would greatly appreciate your expertise. Specifically, I’m trying to extract lux data from Axivity accelerometers using GGIR. The data is in CSV format, which was converted from a parquet file.

I’ve included my code below for reference. If anyone has experience with this or can offer guidance on how to proceed, your input would be invaluable!

GGIR(
  # Basic parameters
  mode = c(1,2,3,4,5,6),                 
  outputdir = outputdir,     
  overwrite = FALSE,         
  do.parallel = TRUE,
  do.report = c(2, 4, 5, 6),  
 
  #=====================
  # read.myacc.csv arguments
  #=====================
  rmc.nrow = Inf, 
  rmc.dec = ".", 
  rmc.firstrow.acc = 2,        
  rmc.col.acc = 2:4,            
  rmc.col.time = 1,            
  rmc.unit.acc = "g",           
  rmc.unit.time = "POSIX",
  rmc.format.time = "%Y-%m-%d %H:%M:%OS",  
  rmc.sf = 12.5,                 
  desiredtz = "Australia/Melbourne",  

  # Part 1
  windowsizes = c(5,900,3600),      
  do.cal = TRUE,
  do.enmo = TRUE,            
  do.anglex = TRUE,            
  do.angley = TRUE,            
  do.anglez = TRUE,            
 
  #=====================
  # Part 2 
  #=====================
  dayborder = 0,
  data_masking_strategy = 1,  
  hrs.del.start = 0,
  hrs.del.end = 0,
  maxdur = 0,
  includedaycrit = 16,
  do.imp = TRUE,
  
  #=====================
  # Part 3 + 4
  #=====================
  ignorenonwear = FALSE,      
  do.part3.pdf = FALSE,  
  HASPT.algo = "HDCZA",                     # SPT-window detection for wrist
  HASIB.algo = "vanHees2015",               # SIB algorithm for wrist
  anglethreshold = c(5,10),             # Angle threshold in degrees
  timethreshold = c(5,10),              # Time threshold in minutes
  includenightcrit = 16,          # Minimum hours for valid night
  def.noc.sleep = 1,          
  do.visual = TRUE,          
  outliers.only = FALSE,      
  loglocation= c(),
 
  LUX_day_segments = c(1,2,3,4,5,6, 12, 18,20,21,22,23,24),
 
  #=====================
  # Part 5
  #=====================
  acc.metric = "ENMO",        
  threshold.lig = c(44.8),    
  threshold.mod = c(100.6),    
  threshold.vig = c(428.8),    
  boutcriter.in = 0.9,      
  boutcriter.lig = 0.8,      
  boutcriter.mvpa = 0.8,    
  boutdur.in = c(10,20,30),  
  boutdur.lig = c(1,5,10),  
  boutdur.mvpa = c(1,5,10),  
  excludefirstlast.part5 = FALSE,
  save_ms5rawlevels = TRUE,  
  save_ms5raw_format = "csv",
  save_ms5raw_without_invalid = TRUE,
 
  #=====================
  # Part 6
  #=====================
  winhr = c(5, 10),
  cosinor = TRUE,
  part6CR = TRUE,
  part6Window = c("start","end"),
 
  #=====================
  # Visual report
  #=====================
  timewindow = c("OO","MM"),  
  visualreport = TRUE,
  old_visualreport = FALSE
)

Thank you!

Best regards,
Rosalind

Vincent van Hees

unread,
May 1, 2025, 10:30:11 AMMay 1
to Rosalind Ge, R package GGIR
Hi Rosalind,

You are correct in exploring the "rmc." parameters to read the file, but unfortunately we do not have functionality yet to read and use lux data stored in csv files.

It is no rocket science and should be straightforward to add. My quick impression is that this requires updates to this, thisthis, and possible a few other files.

I see following options:
  • You or someone else with programming skills makes these updates as a contribution to GGIR. Please make a GitHub pull request and I am happy to review it.
  • You consider hiring me to make this update, please send me a PM if you are interested. Although, please do not feel pressured to hire me. I am happy for someone else to do the work, just offering this as an option. 

Thanks,

Vincent

Dr. Vincent van Hees | Independent consultant | https://accelting.com/
image

--
You received this message because you are subscribed to the Google Groups "R package GGIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to RpackageGGIR...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/RpackageGGIR/23601cd9-917f-4092-b0b8-7c9b03d6ad08n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages