Skip to content

Commit

Permalink
fixes #1250
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Aug 24, 2023
1 parent 5a405e8 commit e2a48d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ parfun <- function(cls, d, fun, model, ...) {
r <- as.matrix(r)
}
if (inherits(model, "gstat")) {
nr <- max(nrow(d), 5)
xy <- as.matrix(d[1:nr,1:2])
if (all(xy == r[1:nr, 1:2])) {
r <- r[,-c(1:2)] # x, y
if (ncol(r) > 2) {
nr <- max(nrow(d), 5)
xy <- as.matrix(d[1:nr,1:2])
if (all(xy == r[1:nr, 1:2])) {
r <- r[,-c(1:2)] # x, y
}
}
}
if (!is.null(index)) {
Expand Down

0 comments on commit e2a48d4

Please sign in to comment.