Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to ignore (filter) short lasting nonwear during nighttime #1230

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

vincentvanhees
Copy link
Member

@vincentvanhees vincentvanhees commented Nov 21, 2024

Fixes #1218 by adding functionality to GGIR part 2 to ignore short nonwear during the night. I did it there, such that all GGIR parts will benefit from it. I hope that the documentation updates made in this PR explain sufficiently what it does and how to use the functionality.

Updates include:

  • Two new parameters to control the nonwear filter
  • Two new variables in output to monitor whether the nonwear filter was used.
  • One new function to perform the nonwear filtering which is called from g.weardec inside g.impute.

Checklist before merging:

  • Existing tests still work (check by running the test suite, e.g. from RStudio).
  • Added tests (if you added functionality) or fixed existing test (if you fixed a bug).
  • Clean code has been attempted, e.g. intuitive object names and no code redundancy.
  • Documentation updated:
    • Function documentation
    • Chapter vignettes for GitHub IO
    • Vignettes for CRAN
  • Corresponding issue tagged in PR message. If no issue exist, please create an issue and tag it.
  • Updated release notes in inst/NEWS.Rd with a user-readable summary. Please, include references to relevant issues or PR discussions.
  • Added your name to the contributors lists in the DESCRIPTION file, if you think you made a significant contribution.
  • GGIR parameters were added/removed. If yes, please also complete checklist below.

If NEW GGIR parameter(s) were added then these NEW parameter(s) are:

  • documented in man/GGIR.Rd
  • included with a default in R/load_params.R
  • included with value class check in R/check_params.R
  • included in table of vignettes/GGIRParameters.Rmd with references to the GGIR parts the parameter is used in.
  • mentioned in NEWS.Rd as NEW parameter

If GGIR parameter(s) were deprecated these parameter(s) are:

  • documented as deprecated in man/GGIR.Rd
  • removed from R/load_params.R
  • removed from R/check_params.R
  • removed from table in vignettes/GGIRParameters.Rmd
  • mentioned as deprecated parameter in NEWS.Rd
  • added to the list in R/extract_params.R with deprecated parameters such that these do not produce warnings when found in old config.csv files.

@vincentvanhees vincentvanhees marked this pull request as ready for review November 21, 2024 10:46
@vincentvanhees
Copy link
Member Author

vincentvanhees commented Nov 22, 2024

I now realise that a limitation of this PR is that it will also run the qwindow functionality even if the user is not interested in this.
I think I have a solution for this and will make a commit for it in the next hour:

If the diary name includes the word "filteronly" then qwindow it is reset to its default c(0, 24) after it was used for the filter functionality. This then applies in both part 2+5, and guarantees freedom for the user to do any of the following:

  • use qwindow do not use nonwear filtering
  • do not use qwindow but use nonwear filter
  • use qwindow and nonwear filtering
  • do not use either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to filter short lasting nonwear during the night
1 participant