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

Use more appropriate NULL handling for unique_ind #341

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ importFrom(purrr,map_dfr)
importFrom(purrr,map_lgl)
importFrom(purrr,pluck)
importFrom(rlang,"!!")
importFrom(rlang,"%||%")
importFrom(rlang,.data)
importFrom(rlang,abort)
importFrom(rlang,enquo)
Expand Down
2 changes: 1 addition & 1 deletion R/rsample-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NULL
#' @importFrom dplyr select %>% bind_cols bind_rows arrange_ arrange full_join
#' @importFrom dplyr mutate last ungroup group_by inner_join summarize do case_when
#' @importFrom vctrs vec_unique_count vec_count vec_slice vec_in
#' @importFrom rlang !! is_call is_string enquo quos exec is_list abort warn .data
#' @importFrom rlang !! is_call is_string enquo quos exec is_list abort warn .data %||%
#' @importFrom methods formalArgs
#' @importFrom stats quantile setNames qnorm pnorm
#' @importFrom tidyselect vars_select one_of
Expand Down
5 changes: 1 addition & 4 deletions R/tidy.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ tidy.rsplit <- function(x, unique_ind = TRUE, ...) {
#' @export
tidy.rset <- function(x, ...) {
dots <- list(...)
unique_ind <- dplyr::if_else(is.null(dots$unique_ind),
TRUE,
dots$unique_ind
)
unique_ind <- dots$unique_ind %||% TRUE
stacked <- purrr::map(x$splits, tidy, unique_ind = unique_ind)
for (i in seq_along(stacked)) {
stacked[[i]]$Resample <- x$id[i]
Expand Down