require(raster)
## Function to aggregate
fun.patch <- function(x) {
if (max(table(x)) >= 0.9 * length(x)) {
return(as.vector(which.max(table(x))))
}
else
return(NA)
}
r.lc <- raster(nrows = 100, ncols = 100)
r.lc[] <- 1:6
aggregate(r.lc, fact = c(5,5), fun.patch)
FUN(newX[, i], ...) 中的错误:未使用的参数 (na.rm = TRUE)