Skip to content

Commit 9877514

Browse files
Show top-level function in error message (#156)
1 parent ff0291b commit 9877514

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

R/spatial_block_cv.R

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,13 @@ generate_folds_from_blocks <- function(data, centroids, grid_blocks, v, n, radiu
262262
# forward
263263
n_indices <- sum(vapply(indices, length, numeric(1)))
264264
if (n_indices > nrow(data)) {
265-
rlang::abort(c(
266-
"Some observations fell exactly on block boundaries, meaning they were assigned to multiple assessment sets unexpectedly.",
267-
i = "Try setting a different `expand_bbox` value, an `offset`, or use a different number of folds."
268-
))
265+
rlang::abort(
266+
c(
267+
"Some observations fell exactly on block boundaries, meaning they were assigned to multiple assessment sets unexpectedly.",
268+
i = "Try setting a different `expand_bbox` value, an `offset`, or use a different number of folds."
269+
),
270+
call = rlang::caller_env(n = 3)
271+
)
269272
}
270273

271274
if (is.null(radius) && is.null(buffer)) {

0 commit comments

Comments
 (0)