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 #2138 Implement derive_vars_extreme_event() #2236

Merged
merged 31 commits into from
Nov 29, 2023

Conversation

jeffreyad
Copy link
Collaborator

@jeffreyad jeffreyad commented Nov 15, 2023

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 devel 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?
  • 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)
  • 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!

@jeffreyad jeffreyad linked an issue Nov 15, 2023 that may be closed by this pull request
Copy link

github-actions bot commented Nov 16, 2023

Code Coverage

Package Line Rate Health
admiral 98%
Summary 98% (4680 / 4776)

@jeffreyad
Copy link
Collaborator Author

@bundfussr I'm not sure if this is exactly what you had in mind, but it seemed like the best option was to create a new helper function derive_extreme() which does most of what derive_extreme_event() previously did and then call that function in two new wrapper functions derive_extreme_event() and derive_vars_extreme_event() to either add the new records as new observations or new variables.

@bundfussr
Copy link
Collaborator

@bundfussr I'm not sure if this is exactly what you had in mind, but it seemed like the best option was to create a new helper function derive_extreme() which does most of what derive_extreme_event() previously did and then call that function in two new wrapper functions derive_extreme_event() and derive_vars_extreme_event() to either add the new records as new observations or new variables.

Sounds good to me. I'll have a closer look later today or on Monday.

NEWS.md Outdated Show resolved Hide resolved
@bms63
Copy link
Collaborator

bms63 commented Nov 18, 2023

Do we want users to have access to this help function? I'm thinking no???

image

@bms63
Copy link
Collaborator

bms63 commented Nov 20, 2023

I think if you add pharmaversesdtm to the Remotes you can get the new changes there so the R-CMD checks pass again? @ddsjoberg correct?

image

You might need to change the Imports to the specific version - new territory for me as well!!

@ddsjoberg
Copy link
Collaborator

@bms63 which R CMD Check error are you trying to solve with the Remotes:?

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.

  • Please update the ADSL vignette and template.
  • Please supersede dthcaus_source and date_source.

R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_var_dthcaus.R Show resolved Hide resolved
R/derive_var_extreme_date.R Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
@bms63
Copy link
Collaborator

bms63 commented Nov 21, 2023

@bms63 which R CMD Check error are you trying to solve with the Remotes:?

My understanding is this is related to a recent update in pharmaversesdtm

image

@bundfussr
Copy link
Collaborator

@bms63 which R CMD Check error are you trying to solve with the Remotes:?

My understanding is this is related to a recent update in pharmaversesdtm

image

Unfortunately, the development version is broken at the moment. We need to merge pharmaverse/pharmaversesdtm#78 and #2241 to fix it.

R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
@manciniedoardo manciniedoardo removed their request for review November 23, 2023 08:38
@manciniedoardo
Copy link
Collaborator

Hi all - hope you don't mind me removing myself from review of this as I won't have time to do a thorough review - please feel free to ask someone else if required.

#' mode = "first",
#' new_vars = exprs(DTHCAUS = DTHCAUS, DTHDT = DTHDT)
#' )
derive_vars_extreme_event <- function(dataset,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we still split this function out into a new file out so it is easy to find in the R folder. I think the events stuff should also get put into a new file, but understand if that is overkill and others don't want to split out

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bms63 Ok, I split into three files.

R/derive_extreme_event.R Outdated Show resolved Hide resolved
inst/templates/ad_adsl.R Outdated Show resolved Hide resolved
R/derive_extreme_event.R Outdated Show resolved Hide resolved
vignettes/adsl.Rmd Outdated Show resolved Hide resolved
@jeffreyad
Copy link
Collaborator Author

  • Please update the ADSL vignette and template.
  • Please supersede dthcaus_source and date_source.

Superseded dthcaus_source and date_source.

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.

Almost done. Just one comment left.

R/derive_vars_extreme_event.R Outdated Show resolved Hide resolved
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.

Thanks for your patience.

@jeffreyad
Copy link
Collaborator Author

Thanks for your patience.

Thanks! I thought of one more thing: I could remove set_values_to from derive_vars_extreme_event() since we set it to NULL in derive_extreme_event().

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.

I'm happy! @jeffreyad @bundfussr shall we click the button!!??!!

@bms63 bms63 merged commit c126ac2 into main Nov 29, 2023
17 of 18 checks passed
@bms63 bms63 deleted the 2138_Implement_derive_vars_extreme_event branch November 29, 2023 16:30
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: Implement derive_vars_extreme_event()
5 participants