Starting Analysis and Visualisation of Spatial Data with R

April 8, 2013

(This article was first published on » R, and kindly contributed to R-bloggers)

Last week I ran an introductory workshop on the analysis and visualisation of spatial data with R. The software has become established as one of the best around for statistics and it is becoming increasingly recognised as a tool for data visualisation (I wrote about this last year, also see here) and spatial analysis. Interest in R is increasing all the time but many feel put off by its very steep learning curve. The help files are often complex and there are some slightly idiosyncratic aspects to the language you have use to get R to work. That said there is lot more help around on forums and some excellent introductory tutorials to get  you started. Here are a couple of worksheets I use to introduce the wonders of R.


The first is written by Richard Harris from the University of Bristol. You can download the worksheet here and the example data from here. I like this worksheet because it is very applied (it is using a real dataset on an important problem), it gets you working with spatial data quickly and it also offers an automated run-through of some of the more advanced stats. It provides a great general introduction to R that can be a basis for more advanced worksheets and tutorials.

ggplot2 map

The second worksheet is one that I have written as an introduction to spatial data visualisation with ggplot2 (a data visualisation package in R). Download instructions here and data here. The code takes you through some of the key functions I often use in ggplot2 to create maps. It also includes faceting which enables you to create lots of graphics as small multiples on a single page. I use this a lot for maps such as the one below of New York Twitter languages:


Here are a couple of additional worksheets from Chris Brunsdon (University of Liverpool) that may be of interest to those who want to do more advanced spatial analysis and I have a few tutorials here. I am sure there are many more good examples out there so feel free to post them in the comments.

To leave a comment for the author, please follow the link and comment on their blog: » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)