Skip to content

Commit

Permalink
Merge pull request #1224 from see24/master
Browse files Browse the repository at this point in the history
Allow fun mean with na.rm = TRUE and weights not is 0, 1, NA
  • Loading branch information
rhijmans authored Jul 10, 2023
2 parents dda7edf + adae5a2 commit 86c9a07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/focal.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function(x, w=3, fun="sum", ..., na.policy="all", fillvalue=NA, expand=FALSE, si
if (!all(m %in% c(0, 1, NA))) {
if (isTRUE(list(...)$na.rm)) {
if (txtfun != "sum") {
error("focal", 'with "na.rm=TRUE" and weights other than 0, 1, or NA, only fun="sum" is allowed')
# error("focal", 'with "na.rm=TRUE" and weights other than 0, 1, or NA, only fun="sum" is allowed')
}
}
}
Expand Down

0 comments on commit 86c9a07

Please sign in to comment.