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

First half of work on expanding functionality to process external function generated event-data #1228

Merged
merged 97 commits into from
Nov 21, 2024

Conversation

vincentvanhees
Copy link
Member

@vincentvanhees vincentvanhees commented Nov 20, 2024

This PR is a preparation for addressing #653, which is about expanding GGIR's functionality to analyse and summarise event type of data produced by external functions. For example, steps, falls, scratches, or whatever events may be of interest to the GGIR user. I did most of this work two years ago as the research group for which I did the work needed time to properly test all functionality. They are happy now but still needs 3-6 months to finalise their work.

However, with their approval I am now merging the fundamental code changes because a lot of it has been complicating/slowing down the development of other parts of GGIR. So, technically there is no major functional enhancement yet for the user.

In summary:

  • New MXLX function added that aims to be more generic and will eventually replace g.getM5L5 and a similar code redundancy in g.part5. This work is already listed in old issue redundant M5L5 code #312, but I could not worked on it until now. Further, this PR tidies up syntax of g.getM5L5 in preparation for such a future merge but makes no functional changes in g.getM5L5.
  • Function aggregateEvent added to facilitate the aggregation of event type outcomes produced by external algorithms.
  • check_myfun.R expanded to facilitate new parameters specific to handling external function output.
  • Function detectEventBouts.R added to facilitate the detection of bouts in event-type behaviours such as steps.
  • Major tidy up and revision of g.analyse.perday.R to incorporate the more elaborate analyses of events produced by external functions.
  • For now all newly generated output variables are suppressed.
  • External function produced event data is now summarised in a separate CSV report and no longer part of the GGIR part2 csv reports.

Next phase in a separate PR next year:

  • Add dedicated vignette to summarise the new functionality
  • Address redundancy in MXLX / M5L5 calculations as discussed in redundant M5L5 code #312.
  • Review parameter and output variable names and implement simplifications where possible.

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.

…re that only anwindices part of metashort is used
…file name, updating documentation and minor fixes related to new bout functionality
@vincentvanhees vincentvanhees marked this pull request as ready for review November 21, 2024 08:42
@vincentvanhees vincentvanhees merged commit aca2c15 into master Nov 21, 2024
9 checks passed
@vincentvanhees vincentvanhees deleted the issue653_step_Nov2024 branch November 21, 2024 08:47
vincentvanhees added a commit that referenced this pull request Nov 22, 2024
ceil because machine precision can sometimes cause matrix() to create a value less than what we want, somehow I missed this in #1228
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.

1 participant