I'm in need of some tutorials/books/other training materials which cover how to use the spplot function in the sp package in R properly.

As with many of these functions, it seems very powerful, but the documentation doesn't seem to be that helpful unless you know exactly what you want to do. I've found various pages of examples, but they still aren't all that clear.

Are there any resources that take you through how to use spplot to produce some useful maps (for example with raster data, plus overlays of polygons on points, with different color scales, legends, north arrows etc) in a nice step-by-step way?

Ideally I'd love a UseR!-style book that focuses on raster data and map production in R, but the only spatial book of that sort seems to be focused mainly on geostatistics and point data.

Any ideas?

  • 1
    I find spplot a bit awkward, relying as it does on the lattice graphics system. Might be easier to use base graphics and then you can just overlay everything with base graphics functions.
    – Spacedman
    Jul 4, 2012 at 9:51

4 Answers 4


I suppose it is the book you have found, but chapter 2 and especially 3 of the Applied Spatial Data Analysis with R cover the creation of maps.

  • 1
    Yeah, I just picked up that book from the library and it was the first thing that came to my mind! Awesome book so far. Very detailed. Highly recommended for any R user that wants to do GIS or GIS user that wants to do analysis. May 31, 2012 at 18:00
  • Materials from the course based on the book are available here bias-project.org.uk/ASDARcourse
    – radek
    Jan 24, 2014 at 18:05

You could try my workshop sessions from this year's UseR! tutorial that I did:


It doesn't use spplot (much) but mostly base graphics with a bit of ggplot thrown in. There's a couple of maps with multiple layers of data. There's no north arrows or scale bars - this isn't cartography - I do that in Quantum GIS.

Maybe this will all end up in a book :)


Oscar Perpiñán's offers very nice materials from his forthcoming book cover spatial and spatio-temporal visualizations with R:

Displaying time series, spatial and space-time data with R (code)

Also make sure to have a look at his blog posts, for instance 'Maps with R (I)' or 'Label placement with spplot and lattice'.

enter image description here


Since spplot is a wrapper for lattice I imagine that the "Lattice Multivariate Data Visualization with R" UseR! book may be helpful.

Personally, I would invest the time in really learning base graphics. Knowing lattice and ggplot are very helpful in extending the R plotting engine. However, for sp class objects I find myself mostly using base graphics and never use spplot. There have been some very good materials provided in the previous answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.