You are here

An Introduction to R for Spatial Analysis and Mapping

An Introduction to R for Spatial Analysis and Mapping

© 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

Well laid out and easy to follow even for non-technical people.

Professor Iseult Lynch
Schl of Geog, Earth & Env'l Sciences, Birmingham University
July 20, 2016

Plain language; use of R

Dr Jochen Albrecht
Geography Dept, Cuny Hunter College
March 31, 2016

Too advanced for my introductory class. Recommended to colleague teaching the advanced section.

Mr Joshua R Rodd
Geography Dept, Middlebury College
December 14, 2015

Open source programs are coming more important in GIS analyses. Commercial GIS-programs does not always provide all essential statistical or spatial tools. In addition, some commercial GIS programs might have expensive licences. Therefore, it is important to have a possibility to utilize free open source programs. The R program is one of these kinds of programs. It has nowadays thousands users globally.

This book is a valuable handbook for those who want to use R for spatial analysis. This book provides important example strings of codes and informative illustrations. These both are essential when trying to guide reader or student deeper to powerful utilization of R in spatial analysis. I will recommend having this handbook as an additional reading in advanced GIS course if student wants to use R-program in his or her own GIS study project.

Dr Petteri Muukkonen
Department of Geography, University of Helsinki
October 16, 2015

Book was too technical. I will definitely recommend it to students but I am not requiring it.

Dr Sumeeta Srinivasan
Urban Environ Policy Plng Dept, Tufts University
August 20, 2015

This book is excellent. Around 50% of the content of my GIS course is taught using R. For many students, this is their first experience of R, and indeed a command-line interface. As such, for many it can be a daunting prospect. I am frequently asked to recommend an introductory textbook and to date, I have not been able to do do this. However, Chris and Lex's book fits the bill perfectly, covering the basics of the R language, handling spatial data, carrying out spatial analyses and working with online data. Throughout the book, the code snippets are particularly useful, with recommendations for helpful packages and functions something that many students will appreciate.

Dr Adam Dennett
Centre for Advanced Spatial Analysis, University College London
May 11, 2015

"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

For instructors

This book is not available as an inspection copy. For more information contact your local sales representative.