5.16 Aggregation

dem = rast(system.file("raster/dem.tif", package = "spDataLarge"))
dem_agg = aggregate(dem, fact = 5, fun = mean) #or median, sum, etc.
plot(dem)

plot(dem_agg)

5.16.1 Disaggregation

dem_disagg = disagg(dem_agg, fact = 5, method = "bilinear") #default: "near"
plot(dem_disagg)

identical(dem, dem_disagg)
## [1] FALSE