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: Clearer documentation needed for functions that require exprs() to be used in input to arguments #2137

Closed
chelseadickens opened this issue Sep 27, 2023 · 17 comments · Fixed by #2250
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@chelseadickens
Copy link

Please select a category the issue is focused on?

Function Documentation

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

I would suggest adding more details about the expected inputs to parameters that require using exprs(). For example, the help documentation for derive_var_merged_exist_flag() makes no mention of needing to use exprs() when specifying by_vars:
image

A user would need to either track back to the documentation for derive_vars_merged() to see more detail about the expected input or assume from the examples at the end of the documentation for derive_var_merged_exist_flag() that they need to use exprs().

I would suggest incorporating some of the details from derive_vars_merged() into the documentation of other functions that have similar requirements:
image

@chelseadickens chelseadickens added the documentation Improvements or additions to documentation label Sep 27, 2023
@bundfussr
Copy link
Collaborator

@chelseadickens , thanks for creating this issue. I think it is a good idea to unify the descriptions.

@pharmaverse/admiral , looks like a good use case for our new roxygen functions concept. Should we create a roxygen_permitted_exprs() function?

@bms63
Copy link
Collaborator

bms63 commented Sep 27, 2023

Yes great use case for roxygen function!!

@chelseadickens would you like to make the updates - we can assist you if needed. admiral team likes to get users involved in updates as we are users ourselves!!

@manciniedoardo
Copy link
Collaborator

really like this idea! thanks for sharing @chelseadickens !

@tgerke
Copy link

tgerke commented Oct 3, 2023

Thanks @chelseadickens for suggesting this (I just landed on this request when I was going to submit a very similar issue) and thanks admiral team for all you do!

From a user perspective, I also find the requirement for arguments wrapped inexprs confusing/non-standard. Once I dug into the code base and stumbled on the help for derive_vars_merged, I see it now. That said, I can picture long-term challenges needing to explain the advanced concepts of defusing and exprs to team members when they pick up admiral for the first time.

I do appreciate that it looks like the notion of accepting tidyselect arguments was discussed recently, and it looks like it may be tackled in the future (which would be awesome!). If that is the plan though, just dropping a quick thought that it may be wise to weigh (understandably limited!) bandwidth for that change against writing lots of further documentation around exprs. The linked issue thread noted stability concerns around tidyselect, but I would think current version 1.2.0 is comparably stable from the user perspective to rlang version 1.1.1, upon which the use of exprs depends.

@manciniedoardo
Copy link
Collaborator

manciniedoardo commented Oct 4, 2023

Thanks for the comment @tgerke. We did weigh up the option of implementing this change before the upcoming admiral 1.0 release, but we cannot commit to having enough time for this big undertaking, and also don't feel it would be right to overhaul the package right before 1.0. As you have noted though we have earmarked this suggestion for future work once we have achieved a stable 1.0 release.

@tgerke
Copy link

tgerke commented Oct 4, 2023

Thanks for the response @manciniedoardo! Understood, will look forward to stable 1.0 (exciting stuff!) and the future improvements.

@StefanThoma StefanThoma self-assigned this Nov 1, 2023
@bms63
Copy link
Collaborator

bms63 commented Nov 7, 2023

Hey @StefanThoma will you be able to complete this before our release on December 4th? I think this will be really helpful for users wondering about exprs and helped bridge the gap from 1.0 and 2.0

@manciniedoardo
Copy link
Collaborator

@StefanThoma Were you thinking of implementing as a vignette or something else?

@StefanThoma
Copy link
Collaborator

@StefanThoma Were you thinking of implementing as a vignette or something else?

@manciniedoardo I was just planning to unify the description of by_vars using a function.
Do you think a vignette is necessary? The examples for each function should also help to guide users.

@manciniedoardo
Copy link
Collaborator

@manciniedoardo I was just planning to unify the description of by_vars using a function. Do you think a vignette is necessary? The examples for each function should also help to guide users.

I think the unification is a good idea, moreover if it could go hand-in-hand with a (short) vignette explaining the exprs() paradigm I think that could be a useful landing page/redirect for users with questions on the subject. @pharmaverse/admiral thoughts?

@bundfussr
Copy link
Collaborator

@manciniedoardo I was just planning to unify the description of by_vars using a function. Do you think a vignette is necessary? The examples for each function should also help to guide users.

I think the unification is a good idea, moreover if it could go hand-in-hand with a (short) vignette explaining the exprs() paradigm I think that could be a useful landing page/redirect for users with questions on the subject. @pharmaverse/admiral thoughts?

I wonder if we need a separate vignette. Maybe we could just link to https://pharmaverse.github.io/admiral/dev/articles/admiral.html#arguments (and update/extend this section if necessary).

@bms63
Copy link
Collaborator

bms63 commented Nov 21, 2023

@manciniedoardo I was just planning to unify the description of by_vars using a function. Do you think a vignette is necessary? The examples for each function should also help to guide users.

I think the unification is a good idea, moreover if it could go hand-in-hand with a (short) vignette explaining the exprs() paradigm I think that could be a useful landing page/redirect for users with questions on the subject. @pharmaverse/admiral thoughts?

I wonder if we need a separate vignette. Maybe we could just link to https://pharmaverse.github.io/admiral/dev/articles/admiral.html#arguments (and update/extend this section if necessary).

I think updating and linking to an existing vignette is the way to go.

@manciniedoardo
Copy link
Collaborator

Sounds good to me too, thanks for the inputs @bms63 @bundfussr

@StefanThoma
Copy link
Collaborator

Does the by_vars argument serve the same purpose in all functions where present?
In derive_adeg_params the by_vars argument is described as:

Only variables specified in by_vars will be populated
in the newly created records.

@StefanThoma
Copy link
Collaborator

I would suggest to keep the function specific content and simply add a general description of how to use the argument underneith. What do you think @bms63 @manciniedoardo ?

@bundfussr
Copy link
Collaborator

bundfussr commented Nov 22, 2023

I would suggest to keep the function specific content and simply add a general description of how to use the argument underneith. What do you think @bms63 @manciniedoardo ?

Makes sense to me. I think it is just the "Permitted Values:" part which should be unified.

@StefanThoma StefanThoma linked a pull request Nov 22, 2023 that will close this issue
14 tasks
@bms63
Copy link
Collaborator

bms63 commented Nov 27, 2023

I would suggest to keep the function specific content and simply add a general description of how to use the argument underneith. What do you think @bms63 @manciniedoardo ?

It sounds good to me as well!

bms63 added a commit that referenced this issue Dec 1, 2023
Merge remote-tracking branch 'origin/main' into 2137-document_by_vars_exprs

# Conflicts:
#	NEWS.md
#	man/extend_source_datasets.Rd
#	man/filter_date_sources.Rd
bms63 added a commit that referenced this issue Dec 1, 2023
Co-authored-by: Zelos Zhu <zelos.zhu@atorusresearch.com>
bms63 added a commit that referenced this issue Dec 1, 2023
bms63 added a commit that referenced this issue Dec 1, 2023
* first few functions

* first few functions

* adapt description

* same for constant_by_vars

* same for constant_by_vars

* updated news.md

* updated news.md

* added short description of exprs()

* added tests

* fix comment

* remove dataset_add argument

* document

* Update R/derive_vars_transposed.R

* Update R/derive_vars_transposed.R

* fix unique

* Update R/roxygen2.R

Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com>

* add backticks

* fixed roxygen2.R

* Update R/derive_merged.R

Co-authored-by: Zelos Zhu <zelos.zhu@atorusresearch.com>

* fix: #2137 Apply suggestions from code review

Co-authored-by: Zelos Zhu <zelos.zhu@atorusresearch.com>

* docs: #2137 re-render

---------

Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com>
Co-authored-by: Ben Straub <ben.x.straub@gsk.com>
Co-authored-by: Zelos Zhu <zelos.zhu@atorusresearch.com>
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
Development

Successfully merging a pull request may close this issue.

6 participants