Skip to content

Commit

Permalink
correct wear_perc_day calculation, fixes #1148
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentvanhees committed Jun 6, 2024
1 parent 72975d8 commit 21b6e63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# CHANGES IN GGIR VERSION 3.1-2

- Report part 5: fix bug that was introduced on 2024-Feb-19 in the calculation of wear percentage #1148

# CHANGES IN GGIR VERSION 3.1-1

- Part 2: Corrected calculation of LXhr and MXhr which had one hour offset when timing was after midnight, #1117
Expand Down
2 changes: 1 addition & 1 deletion R/g.report.part5.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ g.report.part5 = function(metadatadir = c(), f0 = c(), f1 = c(), loglocation = c
x$wear_min_day_spt = (1 - (x$nonwear_perc_day_spt / 100)) * x$dur_day_spt_min #valid minute during waking hours

x$wear_min_day = (1 - (x$nonwear_perc_day / 100)) * x$dur_day_min #valid minute during waking hours
x$wear_perc_day = 100 - (x$nonwear_perc_day / 100) #wear percentage during waking hours
x$wear_perc_day = 100 - x$nonwear_perc_day #wear percentage during waking hours

minimumValidMinutesMM = 0 # default
if (length(params_cleaning[["includedaycrit"]]) == 2) {
Expand Down

0 comments on commit 21b6e63

Please sign in to comment.