I’m trying to resample my raster file to match the resolution of my second raster file as shown below;
pop2 <- resample(pop, grid, method = 'bilinear')
My raster file is population at 100M resolution and the grid is approximately 5km. When I sum the values obtained after resampling, the sum is not equal to the original and it has reduce significantly
# Before
> sum(getValues(pop), na.rm = T)
[1] 3589773
# After
> sum(getValues(pop2), na.rm = T)
[1] 31658.05
What could be happening, and is there a way to retain the sum of the values?