r <- raster()
# a new aggregated raster, no values
ra <- aggregate(r, fact=10)
r <- setValues(r, runif(ncell(r)))
# a new aggregated raster, max of the values
ra <- aggregate(r, fact=10, fun=max)
# multiple layers
s <- stack(r, r*2)
x <- aggregate(s,2)
Run the code above in your browser using DataLab