I have a dataset on some villages like this on a grid:
I want to fill the space of the whole grid so that each grid cell has a value that reflects the pressure from the surrounding villages (i.e., the value would be something like average distance to all villages, weighted by the size of each village).
As a first attempt, I tried to smooth it with:
villageRaster <- focal(villageRaster, w=matrix(1, 9, 9), mean)
But there are still large white areas with no values.
Can someone suggest a nice way to smooth across the whole space?
I am using R for this preferably.