In order to convert a SpatialPixelsDataFrame object "m" into a raster I just do data(meuse.grid) m = SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid) m@data <- data.frame(name="A",m@data) r <- raster(m)
but the actual values are taken from the first column as I'm not selecting the numeric field in the table. Is there a way to select the field as in rasterize? r2 <- rasterize(x=m,y=r, field="dist") It would make sense doing this in just one command. Thanks Agus _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo