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

Add model_out_tbl subsetting functions #202

Merged
merged 3 commits into from
Dec 13, 2024
Merged

Conversation

annakrystalli
Copy link
Member

@annakrystalli annakrystalli commented Dec 13, 2024

This PR resolves #149 by

  • Adding subset_task_id_names() function to subset task ID names from a character vector of column names.
  • Adding functions subset_task_id_cols() and subset_std_cols() to subset a model_out_tbl or submission tbl to task ID or standard (non-task ID) columns respectively.

Note I used a different function name to that proposed in #149 as I feel it's more descriptive and also to avoid any confusion with functions like get_task_id_names() which fetches task ID names from a config file. In general most get_*() functions act on config files so I'd prefer to stick with that convention if that's ok.

I've also made it so that we can also use them on submitted tbl objects which lack the model_id column as they can also be useful in hubValidations

Also, note that the check to ensure that the input contains all task ID columns is not implemented in this function. That would require checking against the config which would require more inputs. To keep these functions lightweight, I leave that check to be performed in higher level functions that call the subset_*_cols() functions.

@annakrystalli annakrystalli requested a review from elray1 December 13, 2024 09:50
Copy link

@annakrystalli annakrystalli changed the title Ak/subset fns/149 Add model_out_tbl subsetting functions Dec 13, 2024
Copy link
Contributor

@elray1 elray1 left a comment

Choose a reason for hiding this comment

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

this is perfect, thanks! I know it's almost trivial functionality but it will be nice to clean this detail up in a few places.

@annakrystalli annakrystalli merged commit b4ff26a into main Dec 13, 2024
8 checks passed
@annakrystalli annakrystalli deleted the ak/subset-fns/149 branch December 13, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add function like get_task_ids_tbl
2 participants