Spatial Analysis in R

Resize the browser window to see the effect.

Spatial Analysis Techniques in R

taught by David Unwin

Aim of Course:

The R environment provides a consistent and stable platform for spatial statistical analysis and is the computing environment of choice for most researchers in the field.

This online course, “Spatial Analysis Techniques in R,” aims to

  • Introduce the use of R for geographic information analysis.  Although much of what will be covered can be accomplished using a GIS, such use is awkward and often highly inefficient;
  • Develop understanding of some topics beyond the basic courses or most standard texts.

After following the course and doing the assignments you will be able to:

  • Install and use the basic R environment;
  • Select an appropriate R package for point, lattice and geostatistical data and enter spatial data into it;
  • Create sensible maps of these same data;
  • Undertake both global and local spatial analysis of the patterns these maps reveal, using the idea of complete spatial randomness as benchmark;
  • Most important of all, critically assess the results of these analyses.

Which course should you take, this one, or "Mapping in R?"

"Spatial analysis techniques in R" employs the standard R methods and packages (spatstat, sp, gstat), with an emphasis on the statistical analysis of three major types of spatial objects: point events, spatial lattices and continuous surfaces.  If your interest is more in the display of spatial data, and especially area lattice data (e.g. states, counties, provinces), including mapping data acquired over the internet, then "Mapping in R" (using GISTools) might be a better choice. There is virtually no overlap between these courses.

This course may be taken individually (one-off) or as part of a certificate program.

Course Program:

WEEK 1: Introducing R

  • spatial and displaying some geographic data including 
    • visualization of point
    • lattice
    • geostatistical data using simple maps

WEEK 2: Point Pattern Analysis

  • global tests against the hypothesis of complete spatial randomness
  • kernel density estimation
  • dealing with non-homogeneity using the spatstat package

WEEK 3: Area (lattice) objects

  • spatial autocorrelation and local statistics including 
    • global autocorrelation
    • local indicators of spatial association
    • geographical weighted regression using the spdep package

WEEK 4: Geostatistical data

  • the analysis of continuous ‘field’ data by variography including
    • interpolation by inverse distance decay
    • trend surface analysis
    • variography
    • kriging using the gstat package

Note that the course does not concentrate on the analysis of spatially continuous data using methods that are collectively referred to as geostatistics but that Lesson 4 covers the basics.

Homework Assignments

There are four assignments in this course. These will be marked by the course leader himself, but whether you need to be concerned with these marks depends on your purpose in taking the course. Some students are interested just in learning for learning's sake, others may require a certificate showing they have completed a course, some may need academic credit (offered in selected courses only).  Students enrolled in a Program in Advanced Statistical Studies also complete a guided project using spatial data.

In addition to assigned readings, this course also has an end of course data modeling project, and supplemental readings available online.

Spatial Analysis Techniques in R

Who Should Take This Course:

The course is aimed at anyone with experience either in spatial analysis using a standard GIS (such as ArcGIS), or who already uses R for basic non-spatial analysis wishing to extend their skills in spatial analysis using R.  Although it covers some of the same ground, students who have followed the course Spatial Statistics with GISgiven by the same instructor will find that this course usefully extends their skills.



You should be familiar with introductory statistics.  Try these self tests to check your knowledge.

You should also be familiar with R, or, at a minimum, a command line environment, since this course involves:

  • Installing and running the R environment;
  • Installing a series of packages (spatstat, map, maptools, sp, lattice, spdep and gstat) designed for use in spatial analysis;
  • Driving these packages at a command line interface; and
  • Reading in data using read.table.

Lesson 1 contains an optional and very basic introduction to these operations that will get you started, but you should be confident of your ability to perform these simple operations in the R environment.  Any 'programming' we do is simply selecting appropriate inputs to the listed packages.  If you are new to R and doubtful about your ability to learn R quickly enough to follow along in the course, we recommend first taking one of the introductory R courses.

Organization of the Course:

This course takes place online at the Institute for 4 weeks. During each course week, you participate at times of your own choosing - there are no set times when you must be online. Course participants will be given access to a private discussion board. In class discussions led by the instructor, you can post questions, seek clarification, and interact with your fellow students and the instructor.

At the beginning of each week, you receive the relevant material, in addition to answers to exercises from the previous session. During the week, you are expected to go over the course materials, work through exercises, and submit answers. Discussion among participants is encouraged. The instructor will provide answers and comments, and at the end of the week, you will receive individual feedback on your homework answers.

Time Requirement:
About 15 hours per week, at times of  your choosing.

Students come to the Institute for a variety of reasons. As you begin the course, you will be asked to specify your category:

  1. You may be interested only in learning the material presented, and not be concerned with grades or a record of completion.
  2. You may be enrolled in PASS (Programs in Analytics and Statistical Studies) that requires demonstration of proficiency in the subject, in which case your work will be assessed for a grade.
  3. You may require a "Record of Course Completion," along with professional development credit in the form of Continuing Education Units (CEU's).  For those successfully completing the course,  CEU's and a record of course completion will be issued by The Institute, upon request.
This course is also recognized by the Institute for Operations Research and the Management Sciences (INFORMS) as helpful preparation for the Certified Analytics Professional (CAP®) exam, and can help CAP®analysts accrue Professional Development Units to maintain their certification .

Course Text:

The required text for this course is Geographic Information Analysis, 2nd ed by David O'Sullivan and David J. Unwin.  It can be purchased here

In addition, students might also like to purchase Bivand, R.S., Pebesma, E. and V. Gomez Rubio (2008) Applied Spatial Data Analyis With R (Springer, NY, in the UseR! Series). This contains all you need to know, but at relatively advanced level.  This optional textbook can be purchased here


You must have a copy of R for the course. Click Here for information on obtaining a free copy.

Spatial Analysis Techniques in R

January 26, 2018 to February 23, 2018January 25, 2019 to February 22, 2019

Course Fee: $589