rnaturalearth
geodata
osmdata
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)
dem_disagg = disagg(dem_agg, fact = 5, method = "bilinear") #default: "near" plot(dem_disagg)
identical(dem, dem_disagg)
## [1] FALSE