Agus, Please see raster::polygonsToRaster
Let 'p' be a SpatialPolygonsDF. Create an appropriate RasterLayer object, for example use the extent of the polygons and set the resolution. r <- raster(extent(p)) res(r) <- 1 # then: r <- polygonsToRaster(p, r) # there are additional arguments to consider # to coerce into a SPGDF spg <- as(r, 'SpatialGridDataFrame') There was a discussion earlier this year, I believe, where there was also an example to do this entirely in sp (using point in polygon overlays) Robert On Sat, Nov 21, 2009 at 5:20 AM, Agustin Lobo <alobolis...@gmail.com> wrote: > Hi? > > Is it possible to perform a vector to raster conversion in R, > from SpatialPolygonsDataFrame to a SpatialGrid (providing the final > resolution? > > In particular, is it possible to do it using package raster? > > (I know this can be done using gdal or grass etc, but I'm trying > to find an "only R" solution) > > Thanks > > Agus > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo