Skip to content

Commit

Permalink
Merge pull request #899 from wadpac/issue896_DQreport
Browse files Browse the repository at this point in the history
data_quality_report when rerunning parts 1 and 2
  • Loading branch information
vincentvanhees authored Sep 11, 2023
2 parents 7bbb934 + 372a737 commit 406d939
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# CHANGES IN GGIR VERSION 2.10-3

- Part 1: Fixed minor bug to keep calibration data in the data quality report after re-running parts 1 and 2 with overwrite = TRUE and backup.cal.coef = "retrieve" #896

- Part 5: Fix minor bug by which GGIR skipped the last day if measurement finishes before midnight and timewindow = MM #891

- Part 4: Added parameter sleepefficiency.metric to decide if in-bed time (denominator) should be guider_spt or acc_spt + latency #811


# CHANGES IN GGIR VERSION 2.10-2

- Part 1: Revision to readability of code (credits: Lena Kushleyeva)
Expand Down
10 changes: 10 additions & 0 deletions R/g.part1.R
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,19 @@ g.part1 = function(datadir = c(), metadatadir = c(), f0 = 1, f1 = c(), myfun = c
bcc.scalei = which(colnames(bcc.data) == "scale.x" | colnames(bcc.data) == "scale.y" | colnames(bcc.data) == "scale.z")
bcc.offseti = which(colnames(bcc.data) == "offset.x" | colnames(bcc.data) == "offset.y" | colnames(bcc.data) == "offset.z")
bcc.temp.offseti = which(colnames(bcc.data) == "temperature.offset.x" | colnames(bcc.data) == "temperature.offset.y" | colnames(bcc.data) == "temperature.offset.z")
bcc.QCmessagei = which(colnames(bcc.data) == "QCmessage")
bcc.npointsi = which(colnames(bcc.data) == "n.10sec.windows")
bcc.nhoursusedi = which(colnames(bcc.data) == "n.hours.considered")
bcc.use.tempi = which(colnames(bcc.data) == "use.temperature")
C$scale = as.numeric(bcc.data[bcc.i[1],bcc.scalei])
C$offset = as.numeric(bcc.data[bcc.i[1],bcc.offseti])
C$tempoffset = as.numeric(bcc.data[bcc.i[1],bcc.temp.offseti])
C$cal.error.start = as.numeric(bcc.data[bcc.i[1],bcc.cal.error.start])
C$cal.error.end = as.numeric(bcc.data[bcc.i[1],bcc.cal.error.end])
C$QCmessage = bcc.data[bcc.i[1],bcc.QCmessagei]
C$npoints = bcc.data[bcc.i[1], bcc.npointsi]
C$nhoursused = bcc.data[bcc.i[1], bcc.nhoursusedi]
C$use.temp = bcc.data[bcc.i[1], bcc.nhoursusedi]
if (verbose == TRUE) {
cat(paste0("\nRetrieved Calibration error (g) before: ",as.numeric(bcc.data[bcc.i[1],bcc.cal.error.start])))
cat(paste0("\nRetrieved Callibration error (g) after: ",as.numeric(bcc.data[bcc.i[1],bcc.cal.error.end])))
Expand Down

0 comments on commit 406d939

Please sign in to comment.