Skip to content

Commit

Permalink
allow for definition of perc, spt_threshold, sptblocksize, spt_max_ga…
Browse files Browse the repository at this point in the history
…p in g.sib.det
  • Loading branch information
jhmigueles committed Dec 18, 2024
1 parent 112d45b commit 9dacc48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/g.sib.det.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
g.sib.det = function(M, IMP, I, twd = c(-12, 12),
acc.metric = "ENMO", desiredtz = "",
myfun=c(), sensor.location = "wrist",
params_sleep = c(), zc.scale = 1, ...) {
params_sleep = c(), zc.scale = 1,...) {
#get input variables
input = list(...)
if (length(input) > 0 || length(params_sleep) == 0) {
Expand All @@ -15,7 +15,11 @@ g.sib.det = function(M, IMP, I, twd = c(-12, 12),
params_sleep = params$params_sleep
}
#==============================================================
perc = 10; spt_threshold = 15; sptblocksize = 30; spt_max_gap = 60 # default configurations (keep hardcoded for now
# perc = 10; spt_threshold = 15; sptblocksize = 30; spt_max_gap = 60 # default configurations (keep hardcoded for now
if (!"perc" %in% names(input)) perc = 10
if (!"spt_threshold" %in% names(input)) spt_threshold = 15
if (!"sptblocksize" %in% names(input)) sptblocksize = 30
if (!"spt_max_gap" %in% names(input)) spt_max_gap = 60
# Abbreviaton SPTE = Sleep Period Time Estimate, although in case of HorAngle it is the Time in Bed estimate
# but then we would have to come up with yet another term to represent the main sleep and/or time in bed window of the day
# So, out of convenience I keep the object name SPTE.
Expand Down

0 comments on commit 9dacc48

Please sign in to comment.