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

Documentation & Templates: Make subject keys consistently flexible #226

Closed
rossfarrugia opened this issue Apr 23, 2024 · 7 comments · Fixed by #239
Closed

Documentation & Templates: Make subject keys consistently flexible #226

rossfarrugia opened this issue Apr 23, 2024 · 7 comments · Fixed by #239
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@rossfarrugia
Copy link
Contributor

Please select a category the issue is focused on?

User Guides

Let us know where something needs a refresh or put your idea here!

There's some examples in the vignettes and the templates where STUDYID or USUBJID are still being called usually in by_vars instead of get_admiral_option("subject_keys"). See https://pharmaverse.github.io/admiral/reference/#admiral-options.

For example see inst/templates/ad_adoe.R or vignettes/advfq.Rmd.

Also in assertion check call in R/derive_var_bcvacritxfl.R.

FYI @manciniedoardo

@rossfarrugia rossfarrugia added documentation Improvements or additions to documentation good first issue Good for newcomers labels Apr 23, 2024
@manciniedoardo manciniedoardo self-assigned this Apr 23, 2024
@aldrichsalva
Copy link
Collaborator

aldrichsalva commented Jun 4, 2024

I added set_admiral_options() right below the library functions in each of the templates based on the example in https://pharmaverse.github.io/admiral/reference/set_admiral_options.html.
image

Would the placement of the function be the same for vignettes?
image

Also, what would be the placement in the functions? Thanks!

@rossfarrugia
Copy link
Contributor Author

@aldrichsalva the admiral package already defaults to these values so you don't need to ever set them in the templates (unless a user ever wanted to change these). you could follow this PR to guide on the updates needed, but bear in mind its still in progress so see the review comments: pharmaverse/admiral#2452

@manciniedoardo
Copy link
Collaborator

thanks @rossfarrugia - @aldrichsalva I believe for admiralophtha you'd just have to replace any mentions like this:

  derive_vars_merged(
    dataset_add = adsl,
    new_vars = adsl_vars,
    by_vars = exprs(STUDYID, USUBJID)
  )

with something like this:

  derive_vars_merged(
    dataset_add = adsl,
    new_vars = adsl_vars,
    by_vars = get_admiral_options("subject_keys")
  )

with the code a little more complex in the case that the by_vars encompass more variables than just the subject keys. See the PR that Ross linked for some examples there.

@rossfarrugia
Copy link
Contributor Author

I made a similar PR for admiralonco earlier for this as FYI: https://github.com/pharmaverse/admiralonco/pull/285/files - there's a couple of minor other pieces updated there too, but in the most part its examples like Edoardo shared above. To find the impacts I used a search on the github repo for USUBJID and then worked from there.

@rossfarrugia
Copy link
Contributor Author

Also I realised that for the admiralroche (closed source) templates we did choose to include the set_admiral_options() call so that might have caused confusion here. I guess that decision was as we have one team using this tool that do likely need to change this option so we made it more visible there as a reminder, but the same wasn't deemed needed in admiral core so better we keep the open source packages consistent.

@manciniedoardo
Copy link
Collaborator

@aldrichsalva any chance you can take a stab at this today, so that we can release tomorrow? otherwise i can take over form you.

@aldrichsalva
Copy link
Collaborator

@manciniedoardo apologies for the delay! Please take over if that is ok.

@manciniedoardo manciniedoardo self-assigned this Jun 11, 2024
manciniedoardo added a commit that referenced this issue Jun 11, 2024
manciniedoardo added a commit that referenced this issue Jun 11, 2024
manciniedoardo added a commit that referenced this issue Jun 11, 2024
* #226 updated subject keys across package

* #226 chore: lint

* #226 more lints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants