The spquery package performs several queries based on spatial raster data.
You can install the development version of spquery from GitHub with:
Contributions to this package are welcome - let us know if you need other distance measures or transformations, have any suggestions, or spotted a bug. The preferred method of contribution is through a GitHub pull request. Feel also free to contact us by creating an issue.