I need to get the cell numbers within a distance (e.g., 10 km) of one point using R, but I didn't figure out how to handle it for the raster data.
library(raster)
r <- raster(ncols=10, nrows=10)
cellFromXY(r, c(2,2)) # get the cell number of one point
How to get the cell numbers within a distance of one point?