I just discovered the exactextractr::exact_resample() function. It works perfectly fine with the stats "mean", "sum", "count", "min", and "max". However, it always returns only NAs when using stats "mode" or "minority", e.g.:
r = raster::raster(resolution = 2)
target = raster::shift(r, 2.5, 1)
set.seed(1111)
raster::values(r) = as.integer(round(rnorm(raster::ncell(r), 0, 1)))
unique(raster::getValues(exactextractr::exact_resample(r, target, fun = "mode")))
[1] NA
unique(raster::getValues(exactextractr::exact_resample(r, target, fun = "min")))
[1] 1 0 -3 -1 -2 2 NA -4
Hello,
I just discovered the exactextractr::exact_resample() function. It works perfectly fine with the stats "mean", "sum", "count", "min", and "max". However, it always returns only NAs when using stats "mode" or "minority", e.g.: