Skip to content
Prev 8889 / 29559 Next

spplot how to control variable scale with colorkey()

On 07/28/2010 12:31 PM, Paulo Eduardo Cardoso wrote:
afaik, not without changing the values of the underlying map plotted.
You can of course first transform the map to a factor, using your legend
boundaries (and labels):

library(sp)
data(meuse.grid)
gridded(meuse.grid) = ~x+y
meuse.grid$distf = factor(findInterval
(meuse.grid$dist,c(0,0.1,0.25,1)),labels=c("0-0.1", "0.1-0.25", "0.25-1"))
spplot(meuse.grid["distf"],col.regions=bpy.colors(3))