Skip to content
Prev 17206 / 29559 Next

How to show the color ramp legend with discrete data in spplot ?

On 01/19/2013 01:26 PM, Jd Devkota wrote:> Hello All,
try:

library(fortunes)
fortune("there is no if")

Reflecting on that, it would involve a bit of programming, essentially
writing an appropriate panel function for lattice::levelplot. I did this
back then for polygons, found in sp:::panel.polygonsplot, which is 80
lines of R code. My guess is that it should be considerable more easy
for points. I'd be happy to receive & consider proposals.
spplot(data1,sp.layout=list(list("sp.polygons",hello),l2,l3,l4,l5),axes=T,xlab="Eastings",cuts=cuts,
3/15, end
Error in spplot(data1, sp.layout = list(list("sp.polygons", hello), l2,  :
  error in evaluating the argument 'obj' in selecting a method for
function 'spplot': Error: object 'data1' not found
We don't have data1, so we can't see what you mean.

Please provide an example that, when copy and pasted, simply runs. This
means: include a library(sp), and import and use a data set available in
a package, such as the meuse data.