Skip to content

Documentation and minor fixes on column names in reports - #1569

Open
jhmigueles wants to merge 12 commits into
mainfrom
issue1568_documentation
Open

jhmigueles wants to merge 12 commits into
mainfrom
issue1568_documentation

Conversation

@jhmigueles

@jhmigueles jhmigueles commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1568 => this PR improves the documentation of the GGIR output, adds 2 new vignettes to document milestone data and visual reports, and fixes some small bugs on column names in the reports found while writing it.

Documentation

  • Data dictionaries are now generated for all reports in results/variableDictionary for parts 2, 4, 6, and for external function event and type reports.
  • New vignettes MilestoneData.Rmd and VisualReports.Rmd.
  • GGIRoutput.Rmd has a new "Data dictionaries" section.
  • dev-functions/reviewDictionaries.R runs GGIR on simulated data with most outputs switched on and lists the variables without a definition, so maintainers can easily review the definitions.
  • The PR template now reminds contributors to add definitions for new report columns.

Minor bug fixes

  • The intensity gradient columns over the full recording were named _fullRecording, so they overwrote each other.
  • With more than one acceleration metric, the LX/MX names over the full recording got the last metric and a .1 suffix.
  • The percentiles of acceleration within the LX/MX of cadence did not include the metric in their names, so they were duplicated with more than one metric. They are now named per metric and expressed in m_g_.
  • The LX/MX of cadence were skipped when they could not be calculated (segment shorter than winhr). This shifted the following columns of that day and misaligned values in part2_dayeventsummary and part2_daytypesummary. They are now stored as NA.
  • With Fitbit data, the column index was reset after the file health variables, so later columns overwrote earlier ones in part2_summary.
  • The part 2 png plotted acceleration in g with an mg y-axis label.

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.
  • If you think you made a significant contribution, add your name to the contributors lists in the DESCRIPTION, zenodo.json, and inst/CITATION files.
  • 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.

…ccumulated ML5AD columns with the current metric, so earlier metrics were labelled with the last metric and later metrics got a ".1" suffix (e.g. L5hr.1_MAD_mg_0-24h_fullRecording). Names are now built only from the columns added for each metric.
…sed to generate column name "_fullRecording" because output_avday$output_avday returns NULL as it does not exist. As a consequence, metrics named with this line (including ig gradient, intercept, and rsquared) replaced each other and only the first survived (duplicated names are later removed in lines 364:371)
…dence (part2 event reports). "acc" in the name did not indicate the acceleration metric, which produced duplicated columns (.1, .2) when more than 1 metric was calculated. Names now include the metric and unit and values are expressed in mg.
…was reset to 10, resulting in overwriting of earlier columns (only Fitbit data).
… (segment shorter than winhr) instead of being skipped. Skipping them shifted the subsequent columns of that day, producing duplicated column names and misaligned values in part2_dayeventsummary and part2_daytypesummary.
… tests and a maintainer script (dev-functions/reviewDictionaries.R) to review the definitions; and documentation in the GGIRoutput vignette. PR template reminds to add definitions for new report columns. #1568

@vincentvanhees vincentvanhees left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jairo, I have not had time to dive into every line of code... I suppose you used a coding agent to check a lot of the syntax. However, I found some high level issues, and it would be great if you could have a look at them.

Comment thread NEWS.md

- Visual reports: Acceleration in the data quality png (results/QC/plots_part2) is now plotted in mg, consistent with its y-axis label. #1568

- Reports, data dictionaries:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had an open issue for documenting the milestone data #752
I think this PR also fixes that? If yes, please tag that issue here in the change log.

expect_equal(daysummary$ExtFunEvent_L2_cad_mean_ENMO_mg_1234hrs, 210041.7, tolerance = 0.05)
expect_equal(daysummary$ExtFunEvent_M2hr_cad_1234hrs, 0)
expect_equal(daysummary$ExtFunEvent_M2_cad_meancad_1234hrs, 36.26251, tolerance = 0.05)
expect_equal(daysummary$ExtFunEvent_M2_cad_mean_ENMO_mg_1234hrs, 60041.67, tolerance = 0.01)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change needed? Why are the columns no longer numeric? If they are not numeric then that indicates a formatting problem in the output and this should be fixed in the code and not in a test

%\VignetteEngine{knitr::rmarkdown}
---

**NOTE: If you are viewing this page via CRAN note that the main GGIR documentation has been migrated to the [GGIR GitHub pages](https://wadpac.github.io/GGIR/).**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure this page is not visible one CRAN, and only visible on GitHub pages. I think we do that via the .RBuildignore file. My intention has been to not put any vignette on CRAN that has not been on CRAN before, because I do not want bother CRAN with all these large vignettes while we display them on github pages. Only the old vignettes that were first released on CRAN will remain there as well as on GitHub pages. In that way we do not need this sentence.


**NOTE: If you are viewing this page via CRAN note that the main GGIR documentation has been migrated to the [GGIR GitHub pages](https://wadpac.github.io/GGIR/).**

# Introduction

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the introduction of milestone data overlaps with https://wadpac.github.io/GGIR/articles/chapter2_Pipeline.html#milestone-data. Please reference that part of the documentation and try to minimize overlap. Some kind of intro is fine, but the less documentation we need to maintain the better :)

%\VignetteEngine{knitr::rmarkdown}
---

**NOTE: If you are viewing this page via CRAN note that the main GGIR documentation has been migrated to the [GGIR GitHub pages](https://wadpac.github.io/GGIR/).**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above, this page should not be visible on CRAN. Make sure it is masked from CRAN like all other vignettes that were first released on github pages.

This branch has not been deployed

No deployments
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.

Enhance documentation: milestone data, visual reports and report dictionaries

2 participants