Skip to content

Commit

Permalink
replace J with list for global function definition
Browse files Browse the repository at this point in the history
  • Loading branch information
advieser authored Nov 6, 2024
1 parent ce7cd6d commit f2d6952
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/PipeOpSubsample.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ PipeOpSubsample = R6Class("PipeOpSubsample",
cutoff_index = which.min(abs(cumsum(shuffled) / nrows - pv$frac))
keep_grps = names(shuffled[seq_len(cutoff_index)])
}
keep = task$groups[J(keep_grps), on = "group", allow.cartesian = TRUE]$row_id
keep = task$groups[list(keep_grps), on = "group", allow.cartesian = TRUE]$row_id
} else if (pv$stratify) {
if (!inherits(task, "TaskClassif")) {
stopf("Stratification not supported for %s", class(task))
Expand Down

0 comments on commit f2d6952

Please sign in to comment.