Skip to content

Commit d81f8ca

Browse files
committed
remove min/max warnings on empty point sets
1 parent f30aa65 commit d81f8ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

R/bbox.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ bb_wrap = function(bb) {
1010
}
1111

1212
bbox.pointmatrix = function(obj, ...) {
13-
bb_wrap(as.vector(t(apply(obj[,1:2,drop=FALSE], 2, range))))
13+
if (nrow(obj) == 0)
14+
bb_wrap(rep(NA_real_, 4))
15+
else
16+
bb_wrap(as.vector(t(apply(obj[,1:2,drop=FALSE], 2, range))))
1417
}
1518

1619
bbox.Set = function(obj, ...) {

0 commit comments

Comments
 (0)