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

Closes #2480 derive pair of variables #2503

Conversation

StefanThoma
Copy link
Collaborator

@StefanThoma StefanThoma commented Sep 4, 2024

Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the main branch until you have checked off each task.

  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
  • Code is formatted according to the tidyverse style guide. Run styler::style_file() to style R and Rmd files
  • Updated relevant unit tests or have written new unit tests, which should consider realistic data scenarios and edge cases, e.g. empty datasets, errors, boundary cases etc. - See Unit Test Guide
  • If you removed/replaced any function and/or function parameters, did you fully follow the deprecation guidance?
  • Review the Cheat Sheet. Make any required updates to it by editing the file inst/cheatsheet/admiral_cheatsheet.pptx and re-upload a PDF and a PNG version of it to the same folder. (The PNG version can be created by taking a screenshot of the PDF version.)
  • Update to all relevant roxygen headers and examples, including keywords and families. Refer to the categorization of functions to tag appropriate keyword/family.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Address any updates needed for vignettes and/or templates
  • Update NEWS.md under the header # admiral (development version) if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers). A Developer Notes section is available in NEWS.md for tracking developer-facing issues.
  • Build admiral site pkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.
  • Address or fix all lintr warnings and errors - lintr::lint_package()
  • Run R CMD check locally and address all errors and warnings - devtools::check()
  • Link the issue in the Development Section on the right hand side.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

Copy link

github-actions bot commented Sep 4, 2024

Code Coverage

Package Line Rate Health
admiral 97%
Summary 97% (4939 / 5101)

@StefanThoma

This comment was marked as resolved.

R/derive_vars_cat.R Outdated Show resolved Hide resolved
@StefanThoma

This comment was marked as resolved.

@bundfussr

This comment was marked as resolved.

bms63

This comment was marked as resolved.

@StefanThoma

This comment was marked as off-topic.

@StefanThoma

This comment was marked as resolved.

@StefanThoma

This comment was marked as resolved.

@bundfussr

This comment was marked as resolved.

@bundfussr
Copy link
Collaborator

bundfussr commented Sep 6, 2024

TODO: Update

  • ~/admiral/inst/templates/ad_advs.R
  • ~/admiral/inst/templates/ad_adpp.R
  • ~/admiral/inst/templates/ad_adex.R
  • ~/admiral/inst/templates/ad_adeg.R
  • ~/admiral/inst/templates/ad_adpc.R
  • vignettes/pk_adnca.Rmd:
  • vignettes/questionnaires.Rmd:
  • vignettes/bds_finding.Rmd:
  • vignettes/bds_exposure.Rmd:

Best to be done in a new issue, I think

I would do it in this MR because updating the templates and vignettes may reveal bugs in the implementation. In this case it is easier to have everything in the same MR.

@bms63
Copy link
Collaborator

bms63 commented Sep 26, 2024

Hey @StefanThoma! I would like one more pass at this from before it gets merged in.

Maybe some fresh eyes on the documentation would be handy as well. @pharmaverse/admiral @pharmaverse/admiral_comm anyone want to review the documentation for this function - does it make sense to you as a new user of this function? Is it working as intended?

@StefanThoma
Copy link
Collaborator Author

Hey @StefanThoma! I would like one more pass at this from before it gets merged in.

Maybe some fresh eyes on the documentation would be handy as well. @pharmaverse/admiral @pharmaverse/admiral_comm anyone want to review the documentation for this function - does it make sense to you as a new user of this function? Is it working as intended?

Sounds good to me!
Let's try to get it out before my end of year review.. 😂

@manciniedoardo
Copy link
Collaborator

Hey @StefanThoma! I would like one more pass at this from before it gets merged in.

Maybe some fresh eyes on the documentation would be handy as well. @pharmaverse/admiral @pharmaverse/admiral_comm anyone want to review the documentation for this function - does it make sense to you as a new user of this function? Is it working as intended?

I had a look as a "new user" of this function. The reference page is well written and self-explanatory - great job @StefanThoma LGTM!

vignettes/.build.timestamp Outdated Show resolved Hide resolved
R/derive_vars_cat.R Outdated Show resolved Hide resolved
R/derive_vars_cat.R Outdated Show resolved Hide resolved
R/derive_vars_cat.R Outdated Show resolved Hide resolved
R/derive_vars_cat.R Outdated Show resolved Hide resolved
#' not matching any of the by groups in `definition`.
#'
#'
#' @details
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not for this PR - but just thinking should we alert the user that something is amiss with their logic if they don't abide by our warning? Not sure if we can detect this first?? @bundfussr

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bms63 , do you mean issuing a warning if there are records which doesn't match any of the by groups?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In the overlap discussion that is in the documentation - like something should be finer in logic??

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if this would be helpful. There are use cases where it makes sense to use overlapping categories, e.g.,

~condition,    ~ANRIND,
AVAL > ANRHI,  "high",
AVAL <= ANRHI, "normal",
TRUE,          "unknown"

Issuing a warning in this case would force the users to suppress the warning or replace TRUE with is.na(AVAL) | is.na(ANRHI).

Copy link
Collaborator

@bms63 bms63 left a comment

Choose a reason for hiding this comment

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

@StefanThoma can we add a test to cover this line please?
image

Copy link
Collaborator

@bms63 bms63 left a comment

Choose a reason for hiding this comment

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

Like 95% there! Can you just add the test and reply to my suggestions/comments. I think mid-day Monday we can merge this in!! Yay!

@StefanThoma
Copy link
Collaborator Author

If tests pass this is done!

@bundfussr
Copy link
Collaborator

If tests pass this is done!

There is one finding left. In line 220 cli_warn() instead of warning() (https://github.com/pharmaverse/admiral/pull/2503/files#r1773577190) should be used.

Copy link
Collaborator

@bundfussr bundfussr left a comment

Choose a reason for hiding this comment

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

@StefanThoma , all is fine from my side now. 🎉
Well done!
Thanks for you patience.

@StefanThoma
Copy link
Collaborator Author

@StefanThoma , all is fine from my side now. 🎉 Well done! Thanks for you patience.

🎉🎉🎉 Thank you for the thorough reviews, that was really helpful :)

@bms63 bms63 merged commit 77666b1 into main Sep 30, 2024
18 of 19 checks passed
@bms63 bms63 deleted the 2480-feature-request-function-for-creating-variable-pairs-like-mcritymlmcritymn branch September 30, 2024 11:49
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.

Feature Request: Function for creating variable pairs like MCRITyML/MCRITyMN
4 participants