From cce11af16a6f42176e5a0540c79da7baf2dae85e Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Wed, 11 Oct 2023 16:44:29 +0200 Subject: [PATCH 01/11] change default nonwear_approach #880 --- NEWS.md | 4 +++- R/load_params.R | 2 +- man/GGIR.Rd | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index c32e1c765..1542cafa1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,6 @@ -# CHANGES IN GGIR VERSION 2.10-5 +# CHANGES IN GGIR VERSION 3.0-0 + +- Part 1 and 2: Change default value for nonwear_approach to 2023 - Part 2: Move cosinor analysis code to its own function in order to ease re-using it in both part 2 and part 6. diff --git a/R/load_params.R b/R/load_params.R index 633f60bb3..1757e2d23 100644 --- a/R/load_params.R +++ b/R/load_params.R @@ -97,7 +97,7 @@ load_params = function(group = c("sleep", "metrics", "rawdata", includenightcrit = 16, #<= to cleaning excludefirst.part4 = FALSE, # => to cleaning excludelast.part4 = FALSE, max_calendar_days = 0, - nonWearEdgeCorrection = TRUE, nonwear_approach = "2013", + nonWearEdgeCorrection = TRUE, nonwear_approach = "2023", segmentWEARcrit.part5 = 0.5, segmentDAYSPTcrit.part5 = c(0,0)) } diff --git a/man/GGIR.Rd b/man/GGIR.Rd index 66ec86f38..9f99868a2 100755 --- a/man/GGIR.Rd +++ b/man/GGIR.Rd @@ -857,7 +857,7 @@ GGIR(mode = 1:5, } \item{nonwear_approach}{ - Character (default = "2013"). + Character (default = "2023"). Whether to use the traditional version of the non-wear detection algorithm (nonwear_approach = "2013") or the new version (nonwear_approach = "2023"). The 2013 version would use the longsize window (windowsizes[3], one hour From 3643a040aaf284dc1fe06aa80fccfa6a40515ed2 Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Wed, 11 Oct 2023 16:45:18 +0200 Subject: [PATCH 02/11] Add documentation for data_quality_report columns --- vignettes/GGIR.Rmd | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/vignettes/GGIR.Rmd b/vignettes/GGIR.Rmd index 15cd603e4..f5eb9f5c5 100644 --- a/vignettes/GGIR.Rmd +++ b/vignettes/GGIR.Rmd @@ -767,6 +767,44 @@ in summary.csv | ig\_intercept_ENMO_0-24hr | Intercept from intensity gradient analysis proposed by [Rowlands et al. 2018](https://journals.lww.com/acsm-msse/Fulltext/2018/06000/Beyond_Cut_%20Points__Accelerometer_Metrics_that.25.aspx) based on metric ENMO for the time segment 0 to 24 hours | | ig\_rsquared_ENMO_0-24hr | r squared from intensity gradient analysis proposed by [Rowlands et al. 2018](https://journals.lww.com/acsm-msse/Fulltext/2018/06000/Beyond_Cut_%20Points__Accelerometer_Metrics_that.25.aspx) based on metric ENMO for the time segment 0 to 24 hours | +### Data_quality_report + +The data_quality_report.csv is stored in subfolder folder results/QC. + +| (Part of) variable name | Description | +|--------------------------|----------------------------------------------| +| filename | file name | +| file.corrupt | Is file corrupt? TRUE or FALSE (mainly tested for GENEActiv bin files) | +| file.too.short | File to short for processing? TRUE or FALSE | +| use.temperature | Temperature used for auto-calibration? TRUE or FALSE | +| scale.x | Auto-calibration scaling coefficient for x-axis (same for y and z axis, not show here) | +| offset.x | Auto-calibration offset coefficient for x-axis (same for y and z axis, not show here) | +| temperature.offset.x | Auto-calibration temperature offset coefficient for x-axis (same for y and z axis, not show here) | +| cal.error.start | Calibration error prior to auto-calibration | +| cal.error.end | Calibration error after auto-calibration | +| n.10sec.windows | Number of 10 second epochs used as sphere data in auto-calibration | +| n.hours.considered | Number of hours of data considered for auto-calibration | +| QCmessage | Character QC message at the end of the auto-calibration | +| mean.temp | Mean temperature in sphere data | +| device.serial.number | Device serial number | +| NFilePagesSkipped | (Only for Axivity .cwa format) Number of data blocks skipped | +| filehealth_totimp_min | (Only for Axivity .cwa format) Total number of minutes of data imputed | +| filehealth_checksumfail_min | (Only for Axivity .cwa format) Total number of minutes of data where the checksum failed | +| filehealth_niblockid_min | (Only for Axivity .cwa format) Total number of minutes of data with non-incremental block ids | +| filehealth_fbias0510_min | (Only for Axivity .cwa format) Total number of minutes with a sampling frequency bias between 5 and 10% | +| filehealth_fbias1020_min | (Only for Axivity .cwa format) Total number of minutes with a sampling frequency bias between 10 and 20% | +| filehealth_fbias2030_min | (Only for Axivity .cwa format) Total number of minutes with a sampling frequency bias between 20 and 30% | +| filehealth_fbias30_min | (Only for Axivity .cwa format) Total number of minutes with a sampling frequency bias higher than 30% | +| filehealth_totimp_N | (Only for Axivity .cwa format) Total number of data blocks that were imputed | +| filehealth_checksumfail_N | (Only for Axivity .cwa format) Total number of blocks where the checksum failed | +| filehealth_niblockid_N | (Only for Axivity .cwa format) Total number of data blocks with non-incremental block ids | +| filehealth_fbias0510_N | (Only for Axivity .cwa format) Total number of data blocks with a sampling frequency bias between 5 and 10% | +| filehealth_fbias1020_N | (Only for Axivity .cwa format) Total number of data blocks with a sampling frequency bias between 10 and 20%| +| filehealth_fbias2030_N | (Only for Axivity .cwa format) Total number of data blocks with a sampling frequency bias between 20 and 30% | +| filehealth_fbias30_N | (Only for Axivity .cwa format) Total number of data blocks with a sampling frequency bias higher than 30% | + + + ## Output part 4 {.tabset} Part 4 generates the following output: @@ -824,7 +862,6 @@ The csv. files contain the variables as shown below. | nonwear_perc_spt | Non-wear percentage during the spt hours of this day. This is a copy of the nonwear_perc_spt calculated in [part 5](#output5), only included in part 4 reports if part 5 has been run with timewindow = WW | - #### Non-default variables in part 4 csv report These additional are only stored if you used a sleeplog that captures From a61fb9b452e6de37c9b9323e942439edd00f0b8a Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Wed, 11 Oct 2023 16:54:10 +0200 Subject: [PATCH 03/11] Fixes #930 by turning off autocalibration when there is no nonmovement --- R/g.calibrate.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/g.calibrate.R b/R/g.calibrate.R index e86a5f90e..f096ffded 100644 --- a/R/g.calibrate.R +++ b/R/g.calibrate.R @@ -324,7 +324,13 @@ g.calibrate = function(datafile, params_rawdata = c(), nomovement = which(meta_temp[,5] < sdcriter & meta_temp[,6] < sdcriter & meta_temp[,7] < sdcriter & abs(as.numeric(meta_temp[,2])) < 2 & abs(as.numeric(meta_temp[,3])) < 2 & abs(as.numeric(meta_temp[,4])) < 2) #the latter three are to reduce chance of including clipping periods - meta_temp = meta_temp[nomovement,] + if (length(nomovement) < 10) { + # take only one row to trigger that autocalibration is skipped + # with the QCmessage that there is not enough data + meta_temp = meta_temp[1, ] + } else { + meta_temp = meta_temp[nomovement,] + } dup = which(rowSums(meta_temp[1:(nrow(meta_temp) - 1), 2:7] == meta_temp[2:nrow(meta_temp), 2:7]) == 3) # remove duplicated values if (length(dup) > 0) meta_temp = meta_temp[-dup,] rm(nomovement, dup) From 21f14d6690fb3b93a42654a85a7a883e9043a196 Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Wed, 11 Oct 2023 17:07:36 +0200 Subject: [PATCH 04/11] improve guidance on usage of segmentDAYSPTcrit.part5, fixes #940 --- NEWS.md | 4 ++++ R/check_params.R | 9 +++++++++ R/load_params.R | 2 +- man/GGIR.Rd | 12 +++++++++--- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 1542cafa1..45fbe3d81 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,10 @@ - Part 2: Arguments hrs.del.start and hrs.del.end when combined with strategy = 3 and strategy = 5 now count relative to start and end of the most active time window as identified. #905 +- Part 5: Change default for segmentDAYSPTcrit.part5 from c(0,0) to c(0, 0.75) and now +prohibiting the use of c(0, 0) as it gives biased estimates. We knew this but clearly some user +used the default without attempting to understand the argument. #940 + # CHANGES IN GGIR VERSION 2.10-4 - Part 4: Now better able to handle nights without sustained inactivity bouts (rest) #911 diff --git a/R/check_params.R b/R/check_params.R index 90b3a069b..d4846fbe1 100644 --- a/R/check_params.R +++ b/R/check_params.R @@ -397,6 +397,15 @@ check_params = function(params_sleep = c(), params_metrics = c(), "fraction of the day between zero and one, please change."), call. = FALSE) } + if (length(params_cleaning[["segmentDAYSPTcrit.part5"]]) != 2) { + stop("\nArgument segmentDAYSPTcrit.part5 is expected to be a numeric vector of length 2", call. = FALSE) + } + if (sum(params_cleaning[["segmentDAYSPTcrit.part5"]]) == 0 | + 0 %in% params_cleaning[["segmentDAYSPTcrit.part5"]] == FALSE) { + stop(paste0("\nArgument segmentDAYSPTcrit.part5 needs to include one zero", + " and cannot include two zeros as this would cause biased", + " behavioural estimates"), call. = FALSE) + } } diff --git a/R/load_params.R b/R/load_params.R index 1757e2d23..ceaa48def 100644 --- a/R/load_params.R +++ b/R/load_params.R @@ -99,7 +99,7 @@ load_params = function(group = c("sleep", "metrics", "rawdata", excludelast.part4 = FALSE, max_calendar_days = 0, nonWearEdgeCorrection = TRUE, nonwear_approach = "2023", segmentWEARcrit.part5 = 0.5, - segmentDAYSPTcrit.part5 = c(0,0)) + segmentDAYSPTcrit.part5 = c(0, 0.75)) } if ("output" %in% group) { params_output = list(epochvalues2csv = FALSE, save_ms5rawlevels = FALSE, diff --git a/man/GGIR.Rd b/man/GGIR.Rd index 9f99868a2..b4131ad5f 100755 --- a/man/GGIR.Rd +++ b/man/GGIR.Rd @@ -831,11 +831,17 @@ GGIR(mode = 1:5, 0.3 indicates that at least 30 percent of the time should be valid.} \item{segmentDAYSPTcrit.part5}{ - Numeric vector or length 2 (default = c(0, 0)). + Numeric vector or length 2 (default = c(0, 0.75)). Inclusion criteria for the proportion of the segment that should be classified as day (awake) and spt (sleep period time) to be considered - valid. Usually, one of the two numbers is 0, and the other defines the - proportion of the segment that should be classified as day or spt.} + valid. One of the two numbers should be 0, and the other defines the + proportion of the segment that should be classified as day or spt. Setting + both to zero would be problematic and not allowed as that would introduce + bias in PA or sleep estimate. The default setting would focus on waking hour + segments and includes all segments that overlap for at least 75 percent + with waking hours. In order to shift focus to the SPT you could use + c(0.75, 0) which ensures that all segments that overlap for at least + 75 percent with the SPT are included.} \item{includedaycrit}{ Numeric (default = 16). From 5ba7e14bbe65369d617625b0bdd9b5dbdba6ce45 Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Wed, 11 Oct 2023 17:57:33 +0200 Subject: [PATCH 05/11] make test_lightPart5 specific to nonwear_approach 2013 --- tests/testthat/test_lightPart5.R | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test_lightPart5.R b/tests/testthat/test_lightPart5.R index 382fb8998..2ceb84a7c 100644 --- a/tests/testthat/test_lightPart5.R +++ b/tests/testthat/test_lightPart5.R @@ -13,7 +13,7 @@ test_that("lux_per_segment is correctly calculated", { # run part 1 GGIR(mode = 1, datadir = fn, outputdir = getwd(), studyname = "test", - do.report = c(), dayborder = 23, verbose = FALSE) + do.report = c(), dayborder = 23, verbose = FALSE, nonwear_approach = "2013") # add lightmean and lightpeak to metalong meta_fn = paste(getwd(), "output_test", "meta", "basic", @@ -37,7 +37,7 @@ test_that("lux_per_segment is correctly calculated", { LUX_day_segments = c(9, 15, 24), dayborder = 23, part5_agg2_60seconds = TRUE, save_ms5rawlevels = TRUE, save_ms5raw_without_invalid = FALSE, - save_ms5raw_format = "RData") + save_ms5raw_format = "RData", nonwear_approach = "2013") # Only segment 9 to 15hr is calculated because it is the only segment # containing awake data in the file generated by create_test_acc_csv @@ -65,4 +65,9 @@ test_that("lux_per_segment is correctly calculated", { expect_equal(diff(mdat[1:2, "timenum"]), 60) #epoch = 60 pm11 = grep("23:00:00", as.character(mdat$timestamp))[1] expect_equal(diff(mdat[(pm11 - 1):pm11, "window"]), 1) #dayborder = 23 (change in window at 23:00) + + outfolder = paste(getwd(), "output_test", sep = .Platform$file.sep) + if (file.exists(outfolder)) unlink(outfolder, recursive = TRUE) + if (file.exists(dn)) unlink(dn, recursive = TRUE) + }) From e6f3fcf748c12e55b297d950c321d3c34613e369 Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Wed, 11 Oct 2023 18:05:51 +0200 Subject: [PATCH 06/11] update version number in preparation for next release --- DESCRIPTION | 4 ++-- man/GGIR-package.Rd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0df28368e..4b25c4082 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: GGIR Type: Package Title: Raw Accelerometer Data Analysis -Version: 2.10-4 -Date: 2023-10-05 +Version: 3.0-0 +Date: 2023-10-20 Authors@R: c(person("Vincent T","van Hees",role=c("aut","cre"), email="v.vanhees@accelting.com"), person("Jairo H","Migueles",role="aut", diff --git a/man/GGIR-package.Rd b/man/GGIR-package.Rd index 7fe811a87..bd7f392db 100755 --- a/man/GGIR-package.Rd +++ b/man/GGIR-package.Rd @@ -21,8 +21,8 @@ \tabular{ll}{ Package: \tab GGIR\cr Type: \tab Package\cr - Version: \tab 2.10-4\cr - Date: \tab 2023-10-05\cr + Version: \tab 3.0-0\cr + Date: \tab 2023-10-20\cr License: \tab Apache License (== 2.0)\cr Discussion group: \tab https://groups.google.com/forum/#!forum/rpackageggir\cr } From 3b2c6e467c57954842b3b324d3d8be23e7092176 Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Wed, 11 Oct 2023 18:09:51 +0200 Subject: [PATCH 07/11] further clarification on the need to consider argument segmentWEARcrit.part5 and segmentDAYSPTcrit.part5 --- man/GGIR.Rd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/man/GGIR.Rd b/man/GGIR.Rd index b4131ad5f..80f7c0223 100755 --- a/man/GGIR.Rd +++ b/man/GGIR.Rd @@ -1159,7 +1159,11 @@ GGIR(mode = 1:5, no need to have a column with the date followed by a column with the next date. If times in the activity diary are not multiple of the short window size (epoch length), the next epoch is considered (e.g., with epoch of 5 - seconds, 8:00:02 will be redefined as 8:00:05 in the activity log).} + seconds, 8:00:02 will be redefined as 8:00:05 in the activity log). + When using the qwindow functionality in combination with GGIR part 5 then + make sure to check that arguments \code{segmentWEARcrit.part5} and + \code{segmentDAYSPTcrit.part5} are specfied to your research needs. + } \item{qwindow_dateformat}{ Character (default = "%d-%m-%Y"). From 81b81b79bd4ea174d8522cc8e01ea4fe5d22f5e9 Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Wed, 11 Oct 2023 18:13:05 +0200 Subject: [PATCH 08/11] improve poor language in cut-points vignette, fixes #937 --- vignettes/CutPoints.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/CutPoints.Rmd b/vignettes/CutPoints.Rmd index 542c73570..20815f2b8 100644 --- a/vignettes/CutPoints.Rmd +++ b/vignettes/CutPoints.Rmd @@ -27,7 +27,7 @@ The physical activity research field has used so called cut-points to segment accelerometer time series based on level of intensity. In this vignette we have compiled a list of published cut-points with instructions on how to use them with GGIR. As newer cut-points are frequently published the list below may not be up to date. -**Please let us know you if know of any cut-points we missed!** +**Please let us know if you are aware of any published cut-points that we missed!** ## Cut-points expressed in gravitational units (this vignette) From c69e46844e8c0e6ca2bbde321630d9e3fa7ef2f1 Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Thu, 12 Oct 2023 08:46:17 +0200 Subject: [PATCH 09/11] requiring the non-zero value to be at least 0.5 in segmentDAYSPTcrit.part5 #940 --- R/check_params.R | 6 +++--- R/load_params.R | 2 +- man/GGIR.Rd | 24 ++++++++++++++++-------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/R/check_params.R b/R/check_params.R index d4846fbe1..b6ca2d120 100644 --- a/R/check_params.R +++ b/R/check_params.R @@ -400,11 +400,11 @@ check_params = function(params_sleep = c(), params_metrics = c(), if (length(params_cleaning[["segmentDAYSPTcrit.part5"]]) != 2) { stop("\nArgument segmentDAYSPTcrit.part5 is expected to be a numeric vector of length 2", call. = FALSE) } - if (sum(params_cleaning[["segmentDAYSPTcrit.part5"]]) == 0 | + if (sum(params_cleaning[["segmentDAYSPTcrit.part5"]]) < 0.5 | 0 %in% params_cleaning[["segmentDAYSPTcrit.part5"]] == FALSE) { stop(paste0("\nArgument segmentDAYSPTcrit.part5 needs to include one zero", - " and cannot include two zeros as this would cause biased", - " behavioural estimates"), call. = FALSE) + " and one value of at least 0.5 as mixing incomplete windows with complete windows", + " biases the estimates"), call. = FALSE) } } diff --git a/R/load_params.R b/R/load_params.R index ceaa48def..5b1faa40f 100644 --- a/R/load_params.R +++ b/R/load_params.R @@ -99,7 +99,7 @@ load_params = function(group = c("sleep", "metrics", "rawdata", excludelast.part4 = FALSE, max_calendar_days = 0, nonWearEdgeCorrection = TRUE, nonwear_approach = "2023", segmentWEARcrit.part5 = 0.5, - segmentDAYSPTcrit.part5 = c(0, 0.75)) + segmentDAYSPTcrit.part5 = c(0, 0.9)) } if ("output" %in% group) { params_output = list(epochvalues2csv = FALSE, save_ms5rawlevels = FALSE, diff --git a/man/GGIR.Rd b/man/GGIR.Rd index 80f7c0223..5fed8b3aa 100755 --- a/man/GGIR.Rd +++ b/man/GGIR.Rd @@ -831,18 +831,26 @@ GGIR(mode = 1:5, 0.3 indicates that at least 30 percent of the time should be valid.} \item{segmentDAYSPTcrit.part5}{ - Numeric vector or length 2 (default = c(0, 0.75)). + Numeric vector or length 2 (default = c(0, 0.9)). Inclusion criteria for the proportion of the segment that should be classified as day (awake) and spt (sleep period time) to be considered valid. One of the two numbers should be 0, and the other defines the - proportion of the segment that should be classified as day or spt. Setting - both to zero would be problematic and not allowed as that would introduce - bias in PA or sleep estimate. The default setting would focus on waking hour - segments and includes all segments that overlap for at least 75 percent + proportion of the segment that should be classified as day or spt, respectively. + The default setting would focus on waking hour + segments and includes all segments that overlap for at least 90 percent with waking hours. In order to shift focus to the SPT you could use - c(0.75, 0) which ensures that all segments that overlap for at least - 75 percent with the SPT are included.} - + c(0.9, 0) which ensures that all segments that overlap for at least + 90 percent with the SPT are included. + Setting both to zero would be problematic and is not allowed as that would introduce + bias in behavioural estimates for the following reason: A complete segment + would be averaged with an incomplete segments (someone going to bed or waking up + in the middle of a segment) by which it is no longer clear whether the person + is less active or sleeps more during that segment. Similarly it is not + clear whether the person has more wakefulness during SPT for a segment or + woke up or went to bed during the segment. Therefore, a + minimum value of 0.5 is required but any value closer to 1 + would be better. + } \item{includedaycrit}{ Numeric (default = 16). Minimum required number of valid hours in day specific analysis From 2f9f0a8944a5e81c2fa462e8b9cc121a5338d28d Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Thu, 12 Oct 2023 09:41:17 +0200 Subject: [PATCH 10/11] Update NEWS.md --- NEWS.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 45fbe3d81..f3c4efbf4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,9 +9,10 @@ - Part 2: Arguments hrs.del.start and hrs.del.end when combined with strategy = 3 and strategy = 5 now count relative to start and end of the most active time window as identified. #905 -- Part 5: Change default for segmentDAYSPTcrit.part5 from c(0,0) to c(0, 0.75) and now -prohibiting the use of c(0, 0) as it gives biased estimates. We knew this but clearly some user -used the default without attempting to understand the argument. #940 +- Part 5: Change default for segmentDAYSPTcrit.part5 from c(0,0) to c(0, 0.9) and now +prohibiting the use of c(0, 0) as it gives biased estimates. We knew this, but some users +started using the default without attempting to understand it, by which it seems necessary +to force a sensible selection. #940 # CHANGES IN GGIR VERSION 2.10-4 From 90a20b1710952ecf459f758ebb9ef17b8a1fa94f Mon Sep 17 00:00:00 2001 From: Vincent van Hees Date: Thu, 12 Oct 2023 17:07:07 +0200 Subject: [PATCH 11/11] address feedback Jairo on PR #941 --- R/load_params.R | 2 +- man/GGIR.Rd | 4 ++-- vignettes/GGIR.Rmd | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/load_params.R b/R/load_params.R index 5b1faa40f..bc9177a1a 100644 --- a/R/load_params.R +++ b/R/load_params.R @@ -99,7 +99,7 @@ load_params = function(group = c("sleep", "metrics", "rawdata", excludelast.part4 = FALSE, max_calendar_days = 0, nonWearEdgeCorrection = TRUE, nonwear_approach = "2023", segmentWEARcrit.part5 = 0.5, - segmentDAYSPTcrit.part5 = c(0, 0.9)) + segmentDAYSPTcrit.part5 = c(0.9, 0)) } if ("output" %in% group) { params_output = list(epochvalues2csv = FALSE, save_ms5rawlevels = FALSE, diff --git a/man/GGIR.Rd b/man/GGIR.Rd index 5fed8b3aa..3800a697f 100755 --- a/man/GGIR.Rd +++ b/man/GGIR.Rd @@ -831,7 +831,7 @@ GGIR(mode = 1:5, 0.3 indicates that at least 30 percent of the time should be valid.} \item{segmentDAYSPTcrit.part5}{ - Numeric vector or length 2 (default = c(0, 0.9)). + Numeric vector or length 2 (default = c(0.9, 0)). Inclusion criteria for the proportion of the segment that should be classified as day (awake) and spt (sleep period time) to be considered valid. One of the two numbers should be 0, and the other defines the @@ -839,7 +839,7 @@ GGIR(mode = 1:5, The default setting would focus on waking hour segments and includes all segments that overlap for at least 90 percent with waking hours. In order to shift focus to the SPT you could use - c(0.9, 0) which ensures that all segments that overlap for at least + c(0, 0.9) which ensures that all segments that overlap for at least 90 percent with the SPT are included. Setting both to zero would be problematic and is not allowed as that would introduce bias in behavioural estimates for the following reason: A complete segment diff --git a/vignettes/GGIR.Rmd b/vignettes/GGIR.Rmd index f5eb9f5c5..3fc64eb8b 100644 --- a/vignettes/GGIR.Rmd +++ b/vignettes/GGIR.Rmd @@ -775,11 +775,11 @@ The data_quality_report.csv is stored in subfolder folder results/QC. |--------------------------|----------------------------------------------| | filename | file name | | file.corrupt | Is file corrupt? TRUE or FALSE (mainly tested for GENEActiv bin files) | -| file.too.short | File to short for processing? TRUE or FALSE | +| file.too.short | File too short for processing? ([definition](#Minimum_recording_duration)) TRUE or FALSE | | use.temperature | Temperature used for auto-calibration? TRUE or FALSE | -| scale.x | Auto-calibration scaling coefficient for x-axis (same for y and z axis, not show here) | -| offset.x | Auto-calibration offset coefficient for x-axis (same for y and z axis, not show here) | -| temperature.offset.x | Auto-calibration temperature offset coefficient for x-axis (same for y and z axis, not show here) | +| scale.x | Auto-calibration scaling coefficient for x-axis (same for y and z axis, not shown here) | +| offset.x | Auto-calibration offset coefficient for x-axis (same for y and z axis, not shown here) | +| temperature.offset.x | Auto-calibration temperature offset coefficient for x-axis (same for y and z axis, not shown here) | | cal.error.start | Calibration error prior to auto-calibration | | cal.error.end | Calibration error after auto-calibration | | n.10sec.windows | Number of 10 second epochs used as sphere data in auto-calibration | @@ -2050,14 +2050,14 @@ which provides the R code and detailed instructions on how to make the radar plots using your own data. -## Minimum recording duration +## Minimum recording duration {#Minimum_recording_duration} GGIR has been designed to process multi-day recordings. The minimum recording duration considered by GGIR depends on the type of analysis: **Running part 1 and 2** -- File size; At least 2MB, where 2MB can be adjusted with argument minimumFileSize. +- File size; At least 2MB, where 2MB can be adjusted with argument minimumFileSizeMB. This should not be changed unless you have good reason to believe that a smaller file size is also acceptable.