Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
R Spatial Analysis Notes

R Spatial Analysis Notes

Spatial Analysis in R

Key Packages

  • sp - defines the set of base classes for spatial data in R. Most useful for creating, converting, merging, transforming (e.g. projection), and plotting (see spplot) Spatial* objects.
  • rgdal - wrapper for GDAL. Most useful for reading in vector data (e.g. ESRI Shapefiles, GeoJSON, KML) with the function readOGR and reading raster data (e.g. NetCDF, GeoTiff) with the function readGDAL.
  • rgeos - wrapper for the GEOS library. Most useful for common spatial operations such as calculating distances between objects, areas, intersections, buffers, centroids, etc. See help(package = "rgeos") for a complete list of functions.
  • raster - provides a set of object classes and functions specific to working with raster data. Most useful for loading, transforming, and analyzing raster data. A particularly useful function getData retrieves commonly used spatial data such as administrative boundaries or world climate data.

R Spatial Resources

R Spatial Tutorials

Spatial Visualization and Mapping

General R Resources


Data Visualization


General GIS Resources

General Data Analysis Resources

  • Tidy Data Wickham (2014). Journal of Statistical Software.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment