Skip to content

Commit

Permalink
Merge pull request wadpac#45 from jhmigueles/master
Browse files Browse the repository at this point in the history
About issue wadpac#9
  • Loading branch information
vincentvanhees authored Jul 27, 2017
2 parents c7c8717 + fd72976 commit c765caa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions R/g.part3.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
g.part3 = function(metadatadir=c(),f0,f1,anglethreshold = 5,
timethreshold = 5,ignorenonwear=FALSE,overwrite=FALSE,desiredtz="Europe/London") {
g.part3 = function(metadatadir=c(),f0,f1,anglethreshold = 5,timethreshold = 5,
metric="ENMO",ignorenonwear=FALSE,overwrite=FALSE,desiredtz="Europe/London") {
# description: function to apply sleep detection functions to milestone data generated by g.part1
#------------------------------------
# create output directory if it does not exist
Expand Down Expand Up @@ -58,7 +58,7 @@ g.part3 = function(metadatadir=c(),f0,f1,anglethreshold = 5,
load(paste(metadatadir,"/meta/basic/",fnames[i],sep=""))
if (M$filecorrupt == FALSE & M$filetooshort == FALSE) {
IMP = g.impute(M,I,strategy=1,hrs.del.start=0,hrs.del.end=0,maxdur=0)
SLE = g.sib.det(M,IMP,I,twd=c(-12,12),timethreshold=timethreshold,anglethreshold=anglethreshold,desiredtz=desiredtz)
SLE = g.sib.det(M,IMP,I,twd=c(-12,12),timethreshold=timethreshold,anglethreshold=anglethreshold,metric=metric,desiredtz=desiredtz)
L5list = SLE$L5list
if (length(SLE$output) > 0 & SLE$detection.failed == FALSE) {
id = as.character(unlist(strsplit(I$filename,"_"))[1])
Expand All @@ -77,4 +77,4 @@ g.part3 = function(metadatadir=c(),f0,f1,anglethreshold = 5,
SI = sessionInfo()

save(SI,file=paste(metadatadir,"/results/QC/sessioninfo_part3.RData",sep=""))
}
}
7 changes: 5 additions & 2 deletions man/g.part3.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ them as nocturnal sleep or day time sustained inactivity periods.
Typical users should work with function g.shell.GGIR only.
}
\usage{
g.part3(metadatadir=c(),f0,f1,anglethreshold = 5,timethreshold = 5,
g.part3(metadatadir=c(),f0,f1,anglethreshold = 5,timethreshold = 5,metric="ENMO",
ignorenonwear=FALSE,overwrite=FALSE,desiredtz="Europe/London")
}
\arguments{
Expand All @@ -37,6 +37,9 @@ g.part3(metadatadir=c(),f0,f1,anglethreshold = 5,timethreshold = 5,
default = 5. This can be specified as multiple thresholds, each of
which will be implemented. For example, timethreshold = c(5,10)
}
\item{metric}{
Which one of the metrics do you want to consider to analyze L5. The metric of interest need to be calculated in M (see \link{g.part1})
}
\item{ignorenonwear}{
If TRUEE then ignore detected monitor non-wear periods to avoid
confusion between monitor non-wear time and sustained inactivity
Expand Down Expand Up @@ -85,4 +88,4 @@ g.part3(metadatadir=metadatadir,anglethreshold=5,timethreshold=5,overwrite=FALSE
\item van Hees VT, Sabia S, et al. (2015) A novel, open access method to
assess sleep duration using a wrist-worn accelerometer, PLoS ONE, November 2015
}
}
}

0 comments on commit c765caa

Please sign in to comment.