Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Aug 24, 2023
1 parent 8418f9a commit 201f622
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions R/focal.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ function(x, w=3, fun="sum", ..., na.policy="all", fillvalue=NA, expand=FALSE, si
}

if (checkNA) {
if (nl > 1) {
mv <- readValues(x[[j]], b$row[i], b$nrows[i])
} else {
mv <- readValues(x, b$row[i], b$nrows[i])
}
if (nl > 1) {
mv <- readValues(x[[j]], b$row[i], b$nrows[i])
} else {
mv <- readValues(x, b$row[i], b$nrows[i])
}

if (na.only) {
k <- !is.na(mv)
Expand Down
5 changes: 2 additions & 3 deletions R/values.R
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,8 @@ setMethod("all.equal", signature(target="SpatRaster", current="SpatRaster"),
hvT <- hasValues(target)
hvC <- hasValues(current)
if (hvT && hvC) {
s <- spatSample(c(target, current), maxcell, "regular")
s1 <- unlist(s[,1:nlyr(target)], use.names = FALSE)
s2 <- unlist(s[,(nlyr(target)+1):(nlyr(target) +nlyr(current))], use.names = FALSE)
s1 <- spatSample(current, maxcell, "regular")
s2 <- spatSample(target, maxcell, "regular")
a <- all.equal(s1, s2, ...)
} else if (hvT || hvC) {
if (hvT) {
Expand Down

0 comments on commit 201f622

Please sign in to comment.