Skip to content

Commit

Permalink
fixes #1600
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Oct 3, 2024
1 parent b0e2dd8 commit 537543d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ setMethod("subset", signature(x="SpatVector"),
TRUE
} else {
e <- substitute(subset)
r <- eval(e, d, parent.frame())
# r <- eval(e, d, parent.frame())
# for #1600
r <- eval(e, d, globalenv())
if (!is.logical(r)) error("subset", "argument 'subset' must be logical")
r & !is.na(r)
}
Expand All @@ -111,7 +113,8 @@ setMethod("subset", signature(x="SpatVector"),
} else {
nl <- as.list(seq_along(d))
names(nl) <- names(d)
eval(substitute(select), nl, parent.frame())
# eval(substitute(select), nl, parent.frame())
eval(substitute(select), nl, globalenv())
}
x <- x[r, v, drop=drop]
} else {
Expand Down

0 comments on commit 537543d

Please sign in to comment.