Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
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 '12 at 9:51

4 Answers 4

up vote 9 down vote accepted

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.

share|improve this answer
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. –  Bryan Goodrich May 31 '12 at 18:00
    
Materials from the course based on the book are available here bias-project.org.uk/ASDARcourse –  radek Jan 24 at 18:05

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

http://www.maths.lancs.ac.uk/~rowlings/Teaching/UseR2012/

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 :)

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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