You are here

An Introduction to R for Spatial Analysis and Mapping

An Introduction to R for Spatial Analysis and Mapping

February 2015 | 360 pages | SAGE Publications Ltd

"In an age of big data, data journalism and with a wealth of quantitative information around us, it is not enough for students to be taught only 100 year old statistical methods using 'out of the box' software. They need to have 21st-century analytical skills too. This is an excellent and student-friendly text from two of the world leaders in the teaching and development of spatial analysis. It shows clearly why the open source software R is not just an alternative to commercial GIS, it may actually be the better choice for mapping, analysis and for replicable research. Providing practical tips as well as fully working code, this is a practical 'how to' guide ideal for undergraduates as well as those using R for the first time. It will be required reading on my own courses."
- Richard Harris, Professor of Quantitative Social Science, University of Bristol

R is a powerful open source computing tool that supports geographical analysis and mapping for the many geography and ‘non-geography’ students and researchers interested in spatial analysis and mapping.

This book provides an introduction to the use of R for spatial statistical analysis, geocomputation and the analysis of geographical information for researchers collecting and using data with location attached, largely through increased GPS functionality.

Brunsdon and Comber take readers from ‘zero to hero’ in spatial analysis and mapping through functions they have developed and compiled into R packages. This enables practical R applications in GIS, spatial analyses, spatial statistics, mapping, and web-scraping. Each chapter includes:

  • Example data and commands for exploring it
  • Scripts and coding to exemplify specific functionality
  • Advice for developing greater understanding - through functions such as locator(), View(), and alternative coding to achieve the same ends
  • Self-contained exercises for students to work through
  • Embedded code within the descriptive text.

 This is a definitive 'how to' that takes students - of any discipline - from coding to actual applications and uses of R.

Part 1: Introduction
Objectives of this book
Spatial Data Analysis in R
Chapters and Learning Arcs
The R Project for Statistical Computing
Obtaining and Running the R software
The R interface
Other resources and accompanying website
Part 2: Data and Plots
The basic ingredients of R: variables and assignment
Data types and Data classes
Reading, writing, loading and saving data
Part 3: Handling Spatial Data in R
Introduction: GISTools
Mapping spatial objects
Mapping spatial data attributes
Simple descriptive statistical analyses
Part 4: Programming in R
Building blocks for Programs
Writing Functions
Writing Functions for Spatial Data
Part 5: Using R as a GIS
Spatial Intersection or Clip Operations
Merging spatial features
Point-in-polygon and Area calculations
Creating distance attributes
Combining spatial datasets and their attributes
Converting between Raster and Vector
Introduction to Raster Analysis
Part 6: Point Pattern Analysis using R
What is Special about Spatial?
Techniques for Point Patterns Using R
Further Uses of Kernal Density Estimation
Second Order Analysis of Point Patterns
Looking at Marked Point Patterns
Interpolation of Point Patterns With Continuous Attributes
The Kringing approach
Part 7: Spatial Attribute Analysis With R
The Pennsylvania Lung Cancer Data
A Visual Exploration of Autocorrelation
Moran's I: An Index of Autocorrelation
Spatial Autoregression
Calibrating Spatial Regression Models in R
Part 8: Localised Spatial Analysis
Setting Up The Data Used in This Chapter
Local Indicators of Spatial Association
Self Test Question
Further Issues with the Above Analysis
The Normality Assumption and Local Moran's-I
Getis and Ord's G-statistic
Geographically Weighted Approaches
Part 9: R and Internet Data
Direct Access to Data
Using RCurl
Working with APIs
Using Specific Packages
Web Scraping

"An introduction to R for spatial analysis and mapping" will be used to supplement our courses related to the spatiality of data (in our case: risk). Nice guidebook for the first stept into this very complex software. Recommended as supplementary book for those students willing to work with R.

Professor Sven Fuchs
Institute of Mountain Risk Engineering, University of Natural Resources and Life Sciences
April 1, 2015

This is an excellent textbook for both underground and postgraduate students as well as researchers. It is the result of a long research and teaching experience of the authors and should be in every geographer's (student or graduate) bookshelf. The book is well structured, well written with great illustrations and adequate theory just enough for the students to keep reading it. As R is considered top 10 programming language in the world and data analysis is now a growing industry that could employ geography graduates, this textbook became available in the right time. I will be referring to it and ask my students to read it! Well done Chris and Lex!

Dr Stamatis Kalogirou
Department of Geography, Harokopio University
March 22, 2015

Excellent guide for beginners to both R and spatial statistics. Practical examples throughout, complete with working code, allow the reader to recreate figures and analyses themselves and learn how to apply techniques to their own data.

Ms Nicola Reeve
Mathematics and Physics, Coventry University
March 16, 2015

Good introduction, but I'll consider this book rather for my advanced Summer School course than for the methods intro at the undergraduate level.

Dr Tobias Bohmelt
Departmemt of Government, Essex University
March 16, 2015

The book is an easy-to-read text for undergraduates and postgraduates who are interested in spatial analysis and cartography. It includes both introductory and advanced topics with working codes for readers to get hands-on experiences of learning by doing. The authors are world leading in this area. I am sure that this book will be of great value not only for students but also researchers in relevant fields as well.

Dr Zhiqiang Feng
School of Geography and Geosciences, St Andrews University
March 15, 2015

It is a very good book for my students in doing their research project.

Dr Abdel-Salam Gomaa Abdel-Salam
Department of Mathematics, Statistics and Physics, University of Qatar
February 23, 2015

Great book!

Mr Cihan Demirtas
Faculty of Business & Management, University of Hannover
February 18, 2015

This is a great introduction for non-specialists.

Dr Anna Feigenbaum
Media School, Bournemouth University
February 9, 2015

Teaching programming in R

Dr Jianquan Cheng
Department Environ'l & Geographical Sciences, Manchester Metropolitan University
September 3, 2014

For instructors

Review and Desk copies for this title are available digitally via VitalSource.

Request e-review copy

If you require a print review copy, please call: (800) 818-7243 ext. 6140 or email