Maybe too obvious to be useful, but have you tried using the "akima"
package for plotting your variable?

It only needs the coordinates and the value of your variable:


require(akima)
                  data(akima)
  ## linear interpolation
  akima.li <- interp(akima$x, akima$y, akima$z)
  image  (akima.li, add=TRUE)
  contour(akima.li, add=TRUE)
  points (akima, pch = 3)

Saludos
Agus



2013/12/10 Oscar Perpiñan <oscar.perpinan@upm.es>

> Hi,
>
> spplot for SpatialPixelsDataFrame is built upon lattice::levelplot.
> Thus, you can use most of its arguments in spplot. For your problem
> you have to set "contour=TRUE" and "region=FALSE". Moreover, you can
> customize the labels with (surprise!) "labels". This is documented in
> the help page of lattice::panel.levelplot:
>
> library(sp)
> data(meuse.grid)
> m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")],
>     data = meuse.grid)
>
> spplot(m["dist"],
>        contour=TRUE, region=FALSE,
>        labels=list(cex=0.6))
>
> Best,
>
> Oscar.
> -----------------------------------------------------------------
> Oscar Perpiñán Lamigueiro
> Dpto. Ingeniería Eléctrica (ETSIDI-UPM)
> Grupo de Sistemas Fotovoltaicos (IES-UPM)
> URL: http://oscarperpinan.github.io
> Twitter: @oscarperpinan
>
>
> 2013/12/9 Agustin Lobo <alobolistas@gmail.com>:
> > I have a set of regularly distributed points (a grid) as a SpatialPoints
> DF.
> > In order to display the distribution of a continuos varaible in the data
> table,
> > I transform to SpatialPixelsDataFrame (using gridded(a) <- TRUE)
> > and after calculating the dimensions of the grid I use rasterize() to
> convert
> > to raster and then use rasterVIS::levelplot()
> >
> > My question is, can equivalent contours be drawn directely on the
> > SpatialPixelsDataFrame object
> > to skip the tansform to raster?
> > I've tried with spplot(), but get filled intervals, not line contours.
> >
> > Thanks
> >
> > Agus
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Agustín Camacho Guerrero.
Doutor em Zoologia.
Laboratório de Herpetologia, Departamento de Zoologia, Instituto de
Biociências, USP.
Rua do Matão, trav. 14, nº 321, Cidade Universitária,
São Paulo - SP, CEP: 05508-090, Brasil.

	[[alternative HTML version deleted]]

