Here's a workaround:
#first resample to higher resolution template <- raster(extent(r), crs = crs(r), resolution = .5) detailedRas <- projectRaster(r, to = template, method = "ngb")
Please note, however, that the amount in this case will not refund the amount of people living in a particular aggregated area.
Ie: Let them say that we have four cells, and these values ββwith a resolution of 1 m:
10 15 12 18
after oversampling to 0.5 using NN:
10 10 15 15 10 10 15 15 12 12 18 18 12 12 18 18
Then, summing up to 1.5 m, we get for the first pixel:
10 + 10 + 15 + 10 + 10 + 15 + 12 + 12 + 18 = 112
Although in fact it should be something like: 10 + 15/2 + 12/2 + 18/4 = 28 (if we assume an equal distribution of the population for each pixel.)
I would recommend using the focal raster function with a user / user function to summarize population values ββas you wish.
Or you divide the re-selected raster by 4, and then take the amount:
2.5 2.5 3.75 3.75 2.5 2.5 3.75 3.75 3 3 4.5 4.5 3 3 4.5 4.5
2.5 + 2.5 + 3.75 + 2.5 + 2.5 + 3.75 + 3 + 3 + 4.5 = 28
source share