-
Notifications
You must be signed in to change notification settings - Fork 8
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
list_select Function Implementation #197
Conversation
- tests - pkgdown - documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is obviously fine! My comments are about the API.
Internally we've used a list_select
-like function because we've tended to start with:
data_all <- extract_tibbles(supertbl)
Is that really what we want users to do? What's the point of this intermediate named list object when you can just do:
extract_tibbles(supertbl, starts_with("tbl"))
It feels to me like we should just be encouraging users to do operations on the supertibble.
Yea, fair enough. Personally fine with closing this if we don't think the value is really there, it didn't take much time to put together. |
Yeah my opinion is that the value isn't there for this but there is value in a more comprehensive set of functions that allows you to select from and manipulate the supertibble |
Say no more 🫡 |
Description
This PR introduced a very low-level function that we've found useful in working with the CGTTrialsReporter. A typical workflow we found was to use
extract_tibbles()
on a REDCap supertibble and then select specific named elements from that list output for our analytic objects. This has the additional benefitA typical workflow, as documented in the roxygen example, is:
Open to name and param suggestions, additional checks, behavior modifications, etc. I originally wanted to call this
supertibble_select()
, but this doesn't really select from the supertibble. If anythingextract_tibbles()
already achieves this.Currently if users make a tidyselection and nothing is returned, an empty named list is returned. But if they hard code a table to search for and it doesn't exist and helpful error is returned. Wasn't sure if both should error instead.
Proposed Changes
List changes below in bullet format:
list_select()
functionPR Checklist
Before submitting this PR, please check and verify below that the submission meets the below criteria:
.RDS
) updated underinst/testdata/create_test_data.R
usethis::use_version()
Code Review
This section to be used by the reviewer and developers during Code Review after PR submission
Code Review Checklist