I hope you are doing well in these strange circumstances.
I am contacting you because I am an user of GGIR and I think something is wrong.
When I run the code with cut points proposed for adults by Hildebrand et al. (sed beh 45.8; mpa 93.2; and mvpa 418.3) I have an excessive amount of MPA (like 342 min for some, 142 min for another person....). I feel this is unrealistic.
#-----------------------------------------------------#
# NOTES
# The following notes should be retained regarding the data:
# R Version: 3.6.1
# GGIR Version: 1.10-7
#-----------------------------------------------------#
#-----------------------------------------------------#
# INSTALL
# Calls required packages and installs if needed.
#-----------------------------------------------------#
checkpack <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
packages <- c("GGIR", "MASS", "signal", "zoo", "mmap", "bitops", "matlab",
"GENEAread", "tuneR", "stringr")
checkpack(packages)
#-----------------------------------------------------#
# SETUP
#-----------------------------------------------------#
# source("file:///C:/Users/s00215420/Desktop/101")
#-----------------------------------------------------#
# SCRIPT
# Runs the script from
#
https://cran.r-project.org/web/packages/GGIR/vignettes/GGIR.html
# with modifications
#-----------------------------------------------------#
#-----------------------------------------------------#
# ***** Child Script ***** #
# too include all data processed by GGIR the thresholds have all been set to 0
# these can and probably should be adjusted based off some criteria
# i.e., includedaycrit coul dbe 10 hours, includenightcrit could be 4 hours
# you may also wish to ignore the first and last day of measurment
# you may also want to make adjustments to strategy and def.noc.sleep
library(GGIR)
g.shell.GGIR(
mode=c(1,2,3,4,5),
datadir="/Users/antoniogarcia-hermoso/Desktop/accel",
outputdir="/Users/antoniogarcia-hermoso/Desktop/accel",
do.report=c(2,4,5),
overwrite=TRUE,
desiredtz="Europe/Madrid",
studyname = "Spain",
#=====================
# Part 2
#=====================
strategy = 3,
#hrs.del.start = 0, hrs.del.end = 0,
maxdur = 0, includedaycrit = 0,
qwindow=c(0,24),
winhr = c(5,10),
qlevels = c(c(1380/1440),c(1410/1440)),
ilevels = c(0,45.8,93.2,418.3,8000),
closedbout=FALSE,
do.imp=TRUE,
mvpathreshold =c(93.2,418.3),
bout.metric = 4,
excludefirstlast = FALSE,
includenightcrit = 0,
#epochvalues2csv = TRUE,
#=====================
# Part 3 + 4
#=====================
def.noc.sleep = 1,
outliers.only = FALSE,
criterror = 4,
do.visual = TRUE,
anglethreshold = 5,
timethreshold = 5,
ignorenonwear = TRUE,
nnights = 9,
#=====================
# Part 5
#=====================
threshold.lig = c(45.8), threshold.mod = c(93.2),threshold.vig = c(418.3),
boutcriter = 0.8,
boutcriter.in = 0.9, boutcriter.lig = 0.8,
boutcriter.mvpa = 0.8,
boutdur.in = c(1,10,30), boutdur.lig = c(1,10),
boutdur.mvpa = c(1),
#save_ms5rawlevels = TRUE,
#=====================
# Visual report
#=====================
timewindow = c("WW"),
visualreport=TRUE,
dofirstpage = TRUE,
viewingwindow=1)