I have several DEMs as geotiff files which I load into R using
raster::raster. Now some of these DEMs contain patches of missing values, represented by
NA. I would like to interpolate these missing values from the surrounding cells using Kriging.
One approach I tried was the
raster::interpolate function. However, the examples in the documentation use spatial points data frames as predictors (from the "meuse" data set) and I can't figure out how it works for my raster.
Several other questions on https://gis.stackexchange.com address similar issues, however none of them provided a working solution for me.
What I also tried is the R package filling. After converting my raster to a matrix, several functions therein work for me, yet I am not sure if these methods are appropriate for the problem at hand.
I have the impression this should be a pretty straightforward issue, yet I could not solve it so far despite considerable effort. Any help would be appreciated.