[R] [STATSGRASS] using spplot (sp package) with 5 quantiles

Edzer J. Pebesma e.pebesma at geo.uu.nl
Fri Oct 5 13:30:51 CEST 2007


Please try

library(sp)
data(meuse)
coordinates(meuse) = ~x+y
spplot(meuse, "zinc", cuts = quantile(meuse$zinc))

Best wishes,
--
Edzer

Mauricio Zambrano wrote:
> Hi,
>
> I'm using R 2.5.1 and gstat 0.9-39 library and I'm working with the
> jura data set provided by gstat library.
>
> I tried to plot a graph of metal concentrations (let's say Cd) with
> the command spplot, but I realized that the default lags are equally
> distributed between Min and Max. I did:
>
> library(gstat)
> data(jura)
> jura.pred.xy <- jura.pred
> names(jura.pred.xy)[1:2] <- c("x", "y")
> coordinates(jura.pred.xy) <- ~x+y
> spplot(jura.pred.xy, scales=list(draw=TRUE), xlab="X direction",
> ylab="Y direction", "Cd", main="Cd concentrations, [ppm]")
>
> I need to use the five quantiles as interval separation and I tried
> with the xyplot and levelplot help of lattice library, but I couldn't
> find how to change this limits.
>
> I know that I can use the command bubble to do this job:
>
> bubble(jura.pred.xy, xlab="X direction", ylab="Y direction", main="Cd
> concentrations, [ppm]")
>
> but I would like to know haw to do it with spplot command
>
> Thanks in advance
>
>



More information about the R-help mailing list