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 get_rsplit() helper #399

Merged
merged 4 commits into from
Dec 7, 2022
Merged

Add get_rsplit() helper #399

merged 4 commits into from
Dec 7, 2022

Conversation

mikemahoney218
Copy link
Member

This fixes #389 by adding a get_rsplit() function:

library(rsample)
val <- withr::with_seed(
  11,
  validation_split(Orange)
)

get_rsplit(val, 1)
#> <Training/Validation/Total>
#> <26/9/35>

Created on 2022-12-07 by the reprex package (v2.0.1)

index <= n_rows

if (!acceptable_index) {
msg <- ifelse(
Copy link
Member Author

Choose a reason for hiding this comment

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

If length(index) > 1, glue returns a line per item of index, which I figure would be overwhelming if you accidentally passed a long vector.

mikemahoney218 and others added 3 commits December 7, 2022 08:50
of adding a method for some other class than `rset` but the main arg being named `rset`
by adding the call that generated the error
Copy link
Member

@hfrick hfrick left a comment

Choose a reason for hiding this comment

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

Thank you! 🙌

@hfrick hfrick merged commit 489d979 into main Dec 7, 2022
@hfrick hfrick deleted the mike/get_rsplit branch December 7, 2022 15:05
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_rsplit() helper to extract split objects?
2 participants