I have raster data with a resolution of 0.5 degrees. I would like to interpolate these to 0.125 and to 1 degree using nearest neighbour interpolation
How can this be implemented in R? Below is some example data:
library(raster)
ras <- raster(res=0.5)
#get polygons for Iceland
iceland <- getData('GADM', country="Iceland", level=1)
cr <- crop(ras, iceland, snap="out")
values(cr) <- 1:ncell(cr)
fr <- mask(cr, iceland)
plot(fr)
lines(iceland)