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

[FEATURE] Add select helpers all_repeating() and all_nonrepeating() to select forms by instrument type #113

Open
4 of 5 tasks
ezraporter opened this issue Dec 14, 2022 · 2 comments
Labels
backlog not to be worked on now enhancement New feature or request

Comments

@ezraporter
Copy link
Collaborator

Feature Request Description

These functions would work with extract_tibbles() and eventually extract_tibble() to make it easy to select all forms of a certain type.

Suggested usage:

extract_tibbles(supertbl, tbls = all_repeating())

extract_tibbles(supertbl, tbls = all_repeating() & starts_with("infusion_"))

Proposed Solution

We may need to do some additional digging to figure out how to implement this. Currently we implement tidyselect functionality by creating a tibble where redcap_form_names are column names and applying tidyselect functions to that tibble. That would no longer work if we wanted selectors that take into account form attributes besides the names (such as types).

I found these helpful for thinking a bit about the issue:

Checklist

  • The issue is atomic
  • The issue description is documented
  • The issue title describes the problem succinctly
  • Developers are assigned to the issue
  • Labels are assigned to the issue
@ezraporter ezraporter added the enhancement New feature or request label Dec 14, 2022
@skadauke
Copy link
Collaborator

skadauke commented Dec 14, 2022

I know that this would be yet another API change, but I think the following usage for tidyselect-enabled functions would be more consistent with dplyr::select() (https://dplyr.tidyverse.org/reference/select.html) and more elegant:

extract_tibbles(supertbl, ...)

Where ... is one or more tidyselect expressions.

Example usage would then be:

supertbl |>
   extract_tibbles(all_nonrepeating(), some_repeated_instrument)

@ezraporter
Copy link
Collaborator Author

Right, that does make sense. We could also still support the tbls argument so it's not a breaking change.

@ezraporter ezraporter added the backlog not to be worked on now label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog not to be worked on now enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants